Documentation ¶
Index ¶
- Constants
- func Len(a kes.KeyAlgorithm) int
- type Key
- func (k *Key) Algorithm() kes.KeyAlgorithm
- func (k *Key) Clone() Key
- func (k *Key) CreatedAt() time.Time
- func (k *Key) CreatedBy() kes.Identity
- func (k *Key) Equal(other Key) bool
- func (k *Key) ID() string
- func (k Key) MarshalBinary() ([]byte, error)
- func (k Key) MarshalText() ([]byte, error)
- func (k *Key) UnmarshalBinary(b []byte) error
- func (k *Key) UnmarshalText(text []byte) error
- func (k *Key) Unwrap(ciphertext, associatedData []byte) ([]byte, error)
- func (k *Key) Wrap(plaintext, associatedData []byte) ([]byte, error)
Constants ¶
const ( // MaxSize is the maximum byte size of an encoded key. MaxSize = 1 << 20 // Size is the byte size of a cryptographic key. Size = 256 / 8 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
Key is a symmetric cryptographic key.
func New ¶
New returns an new Key for the given cryptographic algorithm. The key len must match algorithm's key size. The returned key is owned to the specified identity.
func Random ¶ added in v0.19.2
Random generates a new random Key for the cryptographic algorithm. The returned key is owned to the specified identity.
func (*Key) Algorithm ¶ added in v0.19.2
func (k *Key) Algorithm() kes.KeyAlgorithm
Algorithm returns the cryptographic algorithm for which the key can be used.
func (*Key) CreatedAt ¶ added in v0.19.2
CreatedAt returns the point in time when the key has been created.
func (*Key) CreatedBy ¶ added in v0.19.2
func (k *Key) CreatedBy() kes.Identity
CreatedBy returns the identity that created the key.
func (Key) MarshalBinary ¶ added in v0.20.0
MarshalBinary returns the Key's binary representation.
func (Key) MarshalText ¶ added in v0.19.2
MarshalText returns the key's text representation.
func (*Key) UnmarshalBinary ¶ added in v0.20.0
UnmarshalBinary unmarshals the Key's binary representation.
func (*Key) UnmarshalText ¶ added in v0.19.2
UnmarshalText parses and decodes text as encoded key.