@@ -321,7 +321,8 @@ func (e *EncryptedKey) Serialize(w io.Writer) error {
321
321
322
322
// SerializeEncryptedKeyAEAD serializes an encrypted key packet to w that contains
323
323
// key, encrypted to pub.
324
- // If aeadSupported is set, PKESK v6 is used else v4.
324
+ // If aeadSupported is set, PKESK v6 is used, otherwise v3.
325
+ // Note: aeadSupported MUST match the value passed to SerializeSymmetricallyEncrypted.
325
326
// If config is nil, sensible defaults will be used.
326
327
func SerializeEncryptedKeyAEAD (w io.Writer , pub * PublicKey , cipherFunc CipherFunction , aeadSupported bool , key []byte , config * Config ) error {
327
328
return SerializeEncryptedKeyAEADwithHiddenOption (w , pub , cipherFunc , aeadSupported , key , false , config )
@@ -330,7 +331,8 @@ func SerializeEncryptedKeyAEAD(w io.Writer, pub *PublicKey, cipherFunc CipherFun
330
331
// SerializeEncryptedKeyAEADwithHiddenOption serializes an encrypted key packet to w that contains
331
332
// key, encrypted to pub.
332
333
// Offers the hidden flag option to indicated if the PKESK packet should include a wildcard KeyID.
333
- // If aeadSupported is set, PKESK v6 is used else v4.
334
+ // If aeadSupported is set, PKESK v6 is used, otherwise v3.
335
+ // Note: aeadSupported MUST match the value passed to SerializeSymmetricallyEncrypted.
334
336
// If config is nil, sensible defaults will be used.
335
337
func SerializeEncryptedKeyAEADwithHiddenOption (w io.Writer , pub * PublicKey , cipherFunc CipherFunction , aeadSupported bool , key []byte , hidden bool , config * Config ) error {
336
338
var buf [36 ]byte // max possible header size is v6
@@ -426,6 +428,7 @@ func SerializeEncryptedKeyAEADwithHiddenOption(w io.Writer, pub *PublicKey, ciph
426
428
// key, encrypted to pub.
427
429
// PKESKv6 is used if config.AEAD() is not nil.
428
430
// If config is nil, sensible defaults will be used.
431
+ // Deprecated: Use SerializeEncryptedKeyAEAD instead.
429
432
func SerializeEncryptedKey (w io.Writer , pub * PublicKey , cipherFunc CipherFunction , key []byte , config * Config ) error {
430
433
return SerializeEncryptedKeyAEAD (w , pub , cipherFunc , config .AEAD () != nil , key , config )
431
434
}
@@ -434,6 +437,7 @@ func SerializeEncryptedKey(w io.Writer, pub *PublicKey, cipherFunc CipherFunctio
434
437
// key, encrypted to pub. PKESKv6 is used if config.AEAD() is not nil.
435
438
// The hidden option controls if the packet should be anonymous, i.e., omit key metadata.
436
439
// If config is nil, sensible defaults will be used.
440
+ // Deprecated: Use SerializeEncryptedKeyAEADwithHiddenOption instead.
437
441
func SerializeEncryptedKeyWithHiddenOption (w io.Writer , pub * PublicKey , cipherFunc CipherFunction , key []byte , hidden bool , config * Config ) error {
438
442
return SerializeEncryptedKeyAEADwithHiddenOption (w , pub , cipherFunc , config .AEAD () != nil , key , hidden , config )
439
443
}
0 commit comments