mirrored from https://www.bouncycastle.org/repositories/bc-java
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy AEADSecretKeyEncryptorBuilder from 1857 branch
- Loading branch information
gefeili
committed
Dec 16, 2024
1 parent
6b80483
commit cd9bd33
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
pg/src/main/java/org/bouncycastle/openpgp/operator/AEADSecretKeyEncryptorBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.bouncycastle.openpgp.operator; | ||
|
||
import org.bouncycastle.bcpg.PublicKeyPacket; | ||
|
||
/** | ||
* Implementation provider for AEAD-based {@link PBESecretKeyEncryptor PBESecretKeyEncryptors}. | ||
*/ | ||
public interface AEADSecretKeyEncryptorBuilder | ||
{ | ||
/** | ||
* Build a new {@link PBESecretKeyEncryptor} using the given passphrase. | ||
* Note: As the AEAD protection mechanism includes the public key packet of the key into the calculation, | ||
* if the key you want to protect is supposed to be a subkey, you need to convert it to one <b>before</b> | ||
* calling this method. See {@link org.bouncycastle.openpgp.PGPKeyPair#asSubkey(KeyFingerPrintCalculator)}. | ||
* | ||
* @param passphrase passphrase | ||
* @param pubKey public primary or subkey packet | ||
* @return encryptor using AEAD | ||
*/ | ||
PBESecretKeyEncryptor build(char[] passphrase, PublicKeyPacket pubKey); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters