MCPcopy Index your code
hub / github.com/getsops/sops / encryptWithAge

Method encryptWithAge

keyservice/server.go:91–101  ·  view source on GitHub ↗
(key *AgeKey, plaintext []byte)

Source from the content-addressed store, hash-verified

89}
90
91func (ks *Server) encryptWithAge(key *AgeKey, plaintext []byte) ([]byte, error) {
92 ageKey := age.MasterKey{
93 Recipient: key.Recipient,
94 }
95
96 if err := ageKey.Encrypt(plaintext); err != nil {
97 return nil, err
98 }
99
100 return []byte(ageKey.EncryptedKey), nil
101}
102
103func (ks *Server) decryptWithPgp(key *PgpKey, ciphertext []byte) ([]byte, error) {
104 pgpKey := pgp.NewMasterKeyFromFingerprint(key.Fingerprint)

Callers 1

EncryptMethod · 0.95

Calls 1

EncryptMethod · 0.95

Tested by

no test coverage detected