Package org.webpki.cbor
Interface CBORAsymKeyDecrypter.DecrypterImpl
- Enclosing class:
CBORAsymKeyDecrypter
public static interface CBORAsymKeyDecrypter.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
(PublicKey optionalPublicKey, CBORObject optionalKeyId, KeyEncryptionAlgorithms keyEncryptionAlgorithm, ContentEncryptionAlgorithms contentEncryptionAlgorithm) Locates private decryption key.
-
Method Details
-
locate
PrivateKey locate(PublicKey optionalPublicKey, CBORObject optionalKeyId, 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:
optionalPublicKey
- Optional public key found in the encryption objectoptionalKeyId
- Optional key Id found in the encryption objectkeyEncryptionAlgorithm
- 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.
-