(key *AgeKey, plaintext []byte)
| 89 | } |
| 90 | |
| 91 | func (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 | |
| 103 | func (ks *Server) decryptWithPgp(key *PgpKey, ciphertext []byte) ([]byte, error) { |
| 104 | pgpKey := pgp.NewMasterKeyFromFingerprint(key.Fingerprint) |