Documentation
¶
Index ¶
Constants ¶
View Source
const ( // KindSECP256K1 string identifier for secp256k1 keys. KindSECP256K1 = "secp256k1" // KindSECP256R1 string identifier for secp256r1 keys. KindSECP256R1 = "secp256r1" // KindED25519 string identifier for ed25519 keys. KindED25519 = "ed25519" // KindSR25519 string identifier for sr25519 keys. KindSR25519 = "sr25519" )
View Source
const ( // IDUnknown byte identifier for unknown keys. IDUnknown = 0x0 // IDSECP256K1 byte identifier for secp256k1 keys. IDSECP256K1 = 0xe1 // IDED25519 byte identifier for ed25519 keys. IDED25519 = 0xe2 // IDSR25519 byte identifier for sr25519 keys. IDSR25519 = 0xe3 // IDSECP256R1 Id identifier for secp256r1 keys. IDSECP256R1 = 0xe4 // IDNonSpecified Id identifier for non specified secret keys. IDNonSpecified = 0xee )
Variables ¶
View Source
var CurveKindIDMapping = map[string]byte{ KindSECP256K1: IDSECP256K1, KindED25519: IDED25519, KindSR25519: IDSR25519, KindSECP256R1: IDSECP256R1, }
Functions ¶
Types ¶
type ExtendedPrivateKey ¶
type ExtendedPrivateKey interface {
Bytes() []byte
PrivateKey() PrivateKey
Derive(index uint32) (ExtendedPrivateKey, error)
ExtendedPublicKey() (ExtendedPublicKey, error)
}
type ExtendedPublicKey ¶
type ExtendedPublicKey interface {
Bytes() []byte
PublicKey() PublicKey
Derive(index uint32) (ExtendedPublicKey, error)
}
type PrivateKey ¶
type PrivateKey interface {
// Bytes returns the byte representation of the private key
Bytes() []byte
// PublicKey from the PrivateKey
PublicKey() PublicKey
// Sign signs the message with the key and returns the signature.
Sign(message []byte) ([]byte, error)
}
PrivateKey definition usable in all mailchain crypto operations
type PublicKey ¶
type PublicKey interface {
// Bytes returns the raw bytes representation of the public key.
//
// The returned bytes are used for encrypting, verifying a signature, and locating an address.
Bytes() []byte
// Verify verifies whether sig is a valid signature of message.
Verify(message, sig []byte) bool
}
PublicKey definition usable in all mailchain crypto operations
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cipher collects common cryptographic constants and interfaces.
|
Package cipher collects common cryptographic constants and interfaces. |
|
aes256cbc
Package aes256cbc implements Advanced Encryption Standard with a 256 bit key length, using Chain Block Cipher mode (AES-256-CBC).
|
Package aes256cbc implements Advanced Encryption Standard with a 256 bit key length, using Chain Block Cipher mode (AES-256-CBC). |
|
ciphertest
Package ciphertest is a generated GoMock package.
|
Package ciphertest is a generated GoMock package. |
|
ecdh
Package ecdh has implementations for different asymmetric key exchange.
|
Package ecdh has implementations for different asymmetric key exchange. |
|
noop
Package noop is a no operation encryption algorithm for use when the message is intended to be publically readable.
|
Package noop is a no operation encryption algorithm for use when the message is intended to be publically readable. |
|
Package cryptotest is a generated GoMock package.
|
Package cryptotest is a generated GoMock package. |
|
internal
|
|
|
secp256k1test
Package secp256k1test contains keys that are used to ease testing of Mailchain functionality.
|
Package secp256k1test contains keys that are used to ease testing of Mailchain functionality. |
|
secp256r1test
Package secp256k1test contains keys that are used to ease testing of Mailchain functionality.
|
Package secp256k1test contains keys that are used to ease testing of Mailchain functionality. |
|
sr25519test
Package sr25519test contains keys that are used to ease testing of Mailchain functionality.
|
Package sr25519test contains keys that are used to ease testing of Mailchain functionality. |
Click to show internal directories.
Click to hide internal directories.