Documentation ¶
Index ¶
Constants ¶
View Source
const ( // KEY_AGREEMENT_MULTICODEC_STRING = "x25519-pub" KEY_AGREEMENT_MULTICODEC = mc.X25519Pub KEY_AGREEMENT_KEY_TYPE = "MultiKey" )
View Source
const ( ASSERTION_METHOD_KEY_TYPE = "MultiKey" ASSERTION_METHOD_MULTICODEC = mc.Ed25519Pub )
Variables ¶
View Source
var ( ErrNoType = errors.New("key has no type") ErrInvalidAssertionMethodType = fmt.Errorf("key type must be %s", ASSERTION_METHOD_KEY_TYPE) ErrInvalidKeyAgreementType = fmt.Errorf("key type must be %s", KEY_AGREEMENT_KEY_TYPE) ErrNoPrivateKey = errors.New("key has no private key") ErrNoPublicKey = errors.New("key has no public key") ErrNoPublicKeyMultibase = errors.New("key has no public key multibase") ErrInvalidPublicKeyMultibase = errors.New("invalid public key multibase") ErrInvalidMulticodec = errors.New("invalid multicodec") )
Functions ¶
Types ¶
type EncryptionKey ¶
type EncryptionKey struct { DID did.DID Type string PrivKey [32]byte // Private key PubKey [32]byte // Public key PublicKeyMultibase string }
func NewEncryptionKey ¶
func NewEncryptionKey(identifier string) (EncryptionKey, error)
func (EncryptionKey) IsValid ¶ added in v0.6.0
func (k EncryptionKey) IsValid() bool
func (EncryptionKey) Verify ¶ added in v0.6.0
func (k EncryptionKey) Verify() error
type SigningKey ¶
type SigningKey struct { DID did.DID Type string PrivKey ed25519.PrivateKey PubKey ed25519.PublicKey PublicKeyMultibase string }
func NewSigningKey ¶
func NewSigningKey(identifier string) (SigningKey, error)
Generates a signing key for the given identifier, ie. IPNS name
func (SigningKey) IsValid ¶ added in v0.6.0
func (s SigningKey) IsValid() bool
func (SigningKey) Verify ¶ added in v0.6.0
func (s SigningKey) Verify() error
Click to show internal directories.
Click to hide internal directories.