Versions in this module Expand all Collapse all v1 v1.133.0 Sep 4, 2026 Changes in this version + const FilePrefix type Key + func ResolveKey(value string) (*Key, error) v1.132.0 Sep 4, 2026 Changes in this version + const AlgAESGCM + const AlgECDSASHA256 + const AlgEd25519 + const AlgHMACSHA256 + const AlgRSAOAEP + const AlgRSAPSSSHA256 + const AnnotationEncrypted + const AnnotationEncryptedAlgorithm + const AnnotationSignature + const AnnotationSignatureAlgorithm + const MinRSABits + const MinSecretLen + var ErrAlgorithmMism = errors.New("algorithm mismatch") + var ErrCannotDecrypt = errors.New("key cannot decrypt: a private key or secret is required") + var ErrCannotEncrypt = errors.New("key cannot encrypt") + var ErrCannotSign = errors.New("key cannot sign: a private key or secret is required") + var ErrCannotVerify = errors.New("key cannot verify signatures") + var ErrDecryption = errors.New("decryption failed") + var ErrEncryptNeedsPriv = errors.New(...) + var ErrInvalidSignature = errors.New("signature verification failed") + var ErrNotEncrypted = errors.New("artifact has no encrypted copy") + var ErrNotProtected = errors.New("artifact is neither signed nor encrypted") + var ErrNotSigned = errors.New(...) + var ErrSecretTooShort = fmt.Errorf(...) + var ErrTampered = errors.New("encrypted copy does not match the artifact content") + func IsProtected(annotations map[string]string) bool + type Key struct + func LoadKey(path string) (*Key, error) + func ParseKey(data []byte) (*Key, error) + func (k *Key) CanDecrypt() bool + func (k *Key) CanEncrypt() bool + func (k *Key) CanSign() bool + func (k *Key) CanVerify() bool + func (k *Key) Decrypt(blob []byte) ([]byte, error) + func (k *Key) Describe() string + func (k *Key) Encrypt(data []byte) ([]byte, error) + func (k *Key) EncryptAlgorithm() string + func (k *Key) Fingerprint() string + func (k *Key) Identity() string + func (k *Key) Private() bool + func (k *Key) Protect(annotations map[string]string, data []byte, mode Mode) error + func (k *Key) Recover(annotations map[string]string) ([]byte, error) + func (k *Key) Sign(data []byte) ([]byte, error) + func (k *Key) SignAlgorithm() string + func (k *Key) Supports(mode Mode) error + func (k *Key) Symmetric() bool + func (k *Key) Verify(data, sig []byte) error + func (k *Key) VerifyAnnotations(annotations map[string]string, data []byte) (Verification, error) + type Mode string + const ModeEncrypt + const ModeSign + type Verification struct + EncryptedAlgorithm string + SignatureAlgorithm string + func (v Verification) String() string