Package org.webpki.cbor
Interface CBORX509Decrypter.DecrypterImpl
- Enclosing class:
CBORX509Decrypter
public static interface CBORX509Decrypter.DecrypterImpl
Decrypter engine implementation interface.
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
decrypt
(PrivateKey privateKey, byte[] optionalEncryptedKey, PublicKey optionalEphemeralKey, KeyEncryptionAlgorithms keyEncryptionAlgorithm, ContentEncryptionAlgorithms contentEncryptionAlgorithm) Decrypts encrypted key.locate
(X509Certificate[] certificatePath, KeyEncryptionAlgorithms keyEncryptionAlgorithm, ContentEncryptionAlgorithms contentEncryptionAlgorithm) Locates private decryption key.
-
Method Details
-
locate
PrivateKey locate(X509Certificate[] certificatePath, KeyEncryptionAlgorithms keyEncryptionAlgorithm, ContentEncryptionAlgorithms contentEncryptionAlgorithm) Locates private decryption key.Implementations should preferably throw
CryptoException
for errors related to cryptography and security.This interface also enables encryption parameter verification.
- Parameters:
certificatePath
- Certificate path in the encryption objecttkeyEncryptionAlgorithm
- The requested key encryption algorithmcontentEncryptionAlgorithm
- The requested content encryption algorithm- Returns:
- Private decryption key.
-
decrypt
byte[] decrypt(PrivateKey privateKey, byte[] optionalEncryptedKey, PublicKey optionalEphemeralKey, KeyEncryptionAlgorithms keyEncryptionAlgorithm, ContentEncryptionAlgorithms contentEncryptionAlgorithm) Decrypts encrypted key.Implementations should preferably throw
*CryptoException
for errors related to cryptography and security.- Parameters:
privateKey
- The private decryption keyoptionalEncryptedKey
- Optional encrypted keyoptionalEphemeralKey
- Optional ephemeral keykeyEncryptionAlgorithm
- The requested key encryption algorithmcontentEncryptionAlgorithm
- The requested content encryption algorithm- Returns:
- Decrypted key.
-