| Modifier and Type | Class and Description |
|---|---|
| private static interface |
| Modifier and Type | Field and Description |
|---|---|
| private OperatorHelper | |
| private JcaPGPKeyConverter | |
| private SecureRandom | |
| private static final byte |
| Access | Constructor and Description |
|---|---|
| public | JcePublicKeyKeyEncryptionMethodGenerator(PGPPublicKey
the public key to use for encryption. key)Create a public key encryption method generator with the method to be based on the passed in key. |
| Modifier and Type | Method and Description |
|---|---|
| protected byte[] | encryptSessionInfo(PGPPublicKey
recipients public key pubKey, byte[] session-key sessionKey, byte for v3: session key algorithm ID; for v6: 0 optSymAlgId, boolean isV3)Implements abstract org. Encrypt a session key using the recipients public key. |
| private byte[] | encryptSessionInfoWithECDHKey(KeyPair ephKP, PublicKeyPacket pubKeyPacket, PublicKey cryptoPublicKey, String keyEncryptionOID, int symmetricKeyAlgorithm, byte[] sessionInfo, String agreementName, byte symAlgId, JcePublicKeyKeyEncryptionMethodGenerator.
|
| private byte[] | encryptSessionInfoWithX25519X448Key(PGPPublicKey pgpPublicKey, String algorithmName, PublicKey cryptoPublicKey, String keyEncryptionOID, int symmetricKeyAlgorithm, byte[] sessionKey, String agreementAlgorithmName, int keySize, byte optSymAlgId, boolean isV3)
Note that unlike ECDH, no checksum or padding are appended to the session key before key wrapping. |
| private KeyPair | |
| private byte[] | |
| public JcePublicKeyKeyEncryptionMethodGenerator | |
| public JcePublicKeyKeyEncryptionMethodGenerator | |
| public JcePublicKeyKeyEncryptionMethodGenerator | Returns: the current generator.the secure random to be used. random)Provide a user defined source of randomness. |
| helper | back to summary |
|---|---|
| private OperatorHelper helper | |
| keyConverter | back to summary |
|---|---|
| private JcaPGPKeyConverter keyConverter | |
| random | back to summary |
|---|---|
| private SecureRandom random | |
| X_HDR | back to summary |
|---|---|
| private static final byte X_HDR | |
| JcePublicKeyKeyEncryptionMethodGenerator | back to summary |
|---|---|
| public JcePublicKeyKeyEncryptionMethodGenerator(PGPPublicKey key) Create a public key encryption method generator with the method to be based on the passed in key.
| |
| encryptSessionInfo | back to summary |
|---|---|
| protected byte[] encryptSessionInfo(PGPPublicKey pubKey, byte[] sessionKey, byte optSymAlgId, boolean isV3) throws PGPException Implements abstract org. Doc from org. Encrypt a session key using the recipients public key.
| |
| encryptSessionInfoWithECDHKey | back to summary |
|---|---|
| private byte[] encryptSessionInfoWithECDHKey(KeyPair ephKP, PublicKeyPacket pubKeyPacket, PublicKey cryptoPublicKey, String keyEncryptionOID, int symmetricKeyAlgorithm, byte[] sessionInfo, String agreementName, byte symAlgId, JcePublicKeyKeyEncryptionMethodGenerator. | |
| encryptSessionInfoWithX25519X448Key | back to summary |
|---|---|
| private byte[] encryptSessionInfoWithX25519X448Key(PGPPublicKey pgpPublicKey, String algorithmName, PublicKey cryptoPublicKey, String keyEncryptionOID, int symmetricKeyAlgorithm, byte[] sessionKey, String agreementAlgorithmName, int keySize, byte optSymAlgId, boolean isV3) throws GeneralSecurityException, IOException, PGPException Note that unlike ECDH, no checksum or padding are appended to the session key before key wrapping. Finally, note that unlike the other public-key algorithms, in the case of a v3 PKESK packet, the symmetric algorithm ID is not encrypted. Instead, it is prepended to the encrypted session key in plaintext. In this case, the symmetric algorithm used MUST be AES-128, AES-192 or AES-256 (algorithm ID 7, 8 or 9). | |
| getKeyPair | back to summary |
|---|---|
| private KeyPair getKeyPair(String algorithmName, int keySize) throws GeneralSecurityException | |
| getWrapper | back to summary |
|---|---|
| private byte[] getWrapper(int symmetricKeyAlgorithm, byte optSymAlgId, Key secret, byte[] sessionData) throws PGPException, InvalidKeyException, IllegalBlockSizeException | |
| setProvider | back to summary |
|---|---|
| public JcePublicKeyKeyEncryptionMethodGenerator setProvider(Provider provider) | |
| setProvider | back to summary |
|---|---|
| public JcePublicKeyKeyEncryptionMethodGenerator setProvider(String providerName) | |
| setSecureRandom | back to summary |
|---|---|
| public JcePublicKeyKeyEncryptionMethodGenerator setSecureRandom(SecureRandom random) Provide a user defined source of randomness.
| |
| Modifier and Type | Method and Description |
|---|---|
| public byte[] |
| getEphPubEncoding | back to summary |
|---|---|
| public byte[] getEphPubEncoding(byte[] publicKeyData) | |