summaryrefslogtreecommitdiffstats
path: root/vendor/go.mau.fi/libsignal/keys/identity/IdentityKeyPair.go
blob: 1d401118d7af369516c6c36ca3dfd61c38ff5de5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package identity

import (
	"go.mau.fi/libsignal/ecc"
)

// NewKeyPair returns a new identity key with the given public and private keys.
func NewKeyPair(publicKey *Key, privateKey ecc.ECPrivateKeyable) *KeyPair {
	keyPair := KeyPair{
		publicKey:  publicKey,
		privateKey: privateKey,
	}

	return &keyPair
}

// NewKeyPairFromBytes returns a new identity key from the given serialized bytes.
//func NewKeyPairFromBytes(serialized []byte) KeyPair {
//}

// KeyPair is a holder for public and private identity key pair.
type KeyPair struct {
	publicKey  *Key
	privateKey ecc.ECPrivateKeyable
}

// PublicKey returns the identity key's public key.
func (k *KeyPair) PublicKey() *Key {
	return k.publicKey
}

// PrivateKey returns the identity key's private key.
func (k *KeyPair) PrivateKey() ecc.ECPrivateKeyable {
	return k.privateKey
}

// Serialize returns a byte array that represents the keypair.
//func (k *KeyPair) Serialize() []byte {
//}