Documentation
¶
Index ¶
Constants ¶
View Source
const ( EncByteIdArray = 0x00 EncByteIdInt64 = 0x01 EncByteIdBool = 0x02 EncByteIdList = 0x03 EncByteIdDict = 0x04 EncByteIdBigUint = 0x80 EncByteIdSymKey = 0x90 EncByteIdPubKey = 0x91 EncByteIdPrivKey = 0x92 )
Encoding Byte Identifier
View Source
const ( ClassByteIdSymEncKey = 0x00 ClassByteIdMACKey = 0x01 ClassByteIdAuthEncKey = 0x02 ClassByteIdSigPubkeyOverEC = 0x11 ClassByteIdKEMPubkeyOverEC = 0x12 ClassByteIdAuthPubkeyOverEC = 0x14 )
Class Byte Identifier Page 16 of the Olvid protocol SPEC TODO: attach various ClassByte to ImplemByte accordingly and to ensure consistency. XXX it misses ImplemByteId for each class..
View Source
const ( // Implem ByteId for: ClassByteIdSymEncKey ImplemByteIdAES256CtrKey = 0x00 // Implem ByteId for: ClassByteIdMACKey ImplemByteIdHMACWithSha256Key = 0x00 // Implem ByteId for: ClassByteIdAuthEncKey ImplemByteIdAES256CtrHMACWithSha256Key = 0x00 // Implem ByteId for: ClassByteIdSigPubkeyOverEC ImplemByteIdSigOverMDC = 0x00 ImplemByteIdSigOverCurve25519 = 0x01 // Implem ByteId for: ClassByteIdKEMPubkeyOverEC ImplemByteIdKEMOverMDC = 0x00 ImplemByteIdKEMOverCurve25519 = 0x01 // Implem ByteId for: ClassByteIdAuthPubkeyOverEC ImplemByteIdAuthOverMDC = 0x00 ImplemByteIdAuthOverCurve25519 = 0x01 )
View Source
const ( LEN_IV = 8 LEN_KEY = 32 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CryptographicKey ¶
type CryptographicKey struct {
AlgoClassId byte
AlgoImplemId byte
Dict Dict // most probably map[string][]byte
EncByteId byte
}
func NewCryptographicKey ¶
func NewCryptographicKey(classId, implemId byte, d Dict, encId byte) *CryptographicKey
* * SYMMETRIC KEY *
type PrivateKey ¶
type PrivateKey CryptographicKey
func NewPrivateKey ¶
func NewPrivateKey(classId, implemId byte, dict Dict) *PrivateKey
func PrivateKeyFromKey ¶
func PrivateKeyFromKey(ck *CryptographicKey) *PrivateKey
func (*PrivateKey) CryptographicKey ¶
func (pk *PrivateKey) CryptographicKey() *CryptographicKey
type PublicKey ¶
type PublicKey CryptographicKey
func NewPublicKey ¶
func PublicKeyFromKey ¶
func PublicKeyFromKey(ck *CryptographicKey) *PublicKey
func (*PublicKey) CryptographicKey ¶
func (pk *PublicKey) CryptographicKey() *CryptographicKey
type SymmetricKey ¶
type SymmetricKey CryptographicKey
* * SYMMETRIC KEY *
type SymmetricKey struct {
*CryptographicKey
}
func NewSymmetricKey ¶
func NewSymmetricKey(classId, implemId byte, d Dict) *SymmetricKey
func SymmetricKeyFromKey ¶
func SymmetricKeyFromKey(ck *CryptographicKey) *SymmetricKey
func (*SymmetricKey) CryptographicKey ¶
func (symk *SymmetricKey) CryptographicKey() *CryptographicKey
Click to show internal directories.
Click to hide internal directories.