public interface DataUnsealer
A DataUnsealer is a thread safe object that can unseal data protected according to the eHealth end-to-end encryption specifications.
A DataUnsealer has a strong association with an reader, because it decrypts data with the private decryption keys of the reader.
Consequently a DataUnsealer must be created for each reader. Use the DataUnsealerBuilder to create DataUnsealers. Once the
DataUnsealer is created, it can be used for several messages. It can be used simultaneously by multiple threads.
To unseal the data, you need
DataUnsealerBuilder,
UnsealedData| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getKekID(byte[] sealedData)
Gets the base 64 encode KEK id in the sealed data.
|
java.lang.String |
getSubjectKeyIdentifier(byte[] sealedData)
Gets the base 64 encoded SubjectKeyIdentifier of the signer's key in the signed data.
|
CryptoResult<UnsealedData> |
unseal(byte[] data)
Unseals the data using the private keys that were provided to the DataUnsealerFactory when this DataUnsealer was created.
|
CryptoResult<UnsealedData> |
unseal(byte[] data,
javax.crypto.SecretKey kek)
Unseals the data using the given Key Encryption Key.
|
CryptoResult<UnsealedData> |
unseal(byte[] data,
javax.crypto.SecretKey kek,
SigningCredential... signers)
Unseals the data using the given Key Encryption Key and validate the signature using the given signer credential(s).
|
CryptoResult<UnsealedData> |
unseal(byte[] data,
SigningCredential... signers)
Unseals the data using the private keys that were provided to the DataUnsealerFactory when this DataUnsealer was created and validate
the signature using the given signer credential(s).
|
CryptoResult<UnsealedData> |
unseal(java.io.InputStream sealedData,
java.io.OutputStream unsealedData)
Unseals the data using the private keys that were provided to the DataUnsealerFactory when this DataUnsealer was created.
|
CryptoResult<UnsealedData> |
unseal(java.io.InputStream sealedData,
java.io.OutputStream unsealedData,
javax.crypto.SecretKey kek)
Unseals the data using the given Key Encryption Key.
|
CryptoResult<UnsealedData> |
unseal(java.io.InputStream sealedData,
java.io.OutputStream unsealedData,
javax.crypto.SecretKey kek,
SigningCredential... signers)
Unseals the data using the given Key Encryption Key and validate the signature using the given signer credential(s).
|
CryptoResult<UnsealedData> |
unseal(java.io.InputStream sealedData,
java.io.OutputStream unsealedData,
SigningCredential... signers)
Unseals the data using the private keys that were provided to the DataUnsealerFactory when this DataUnsealer was created and validate
the signature using the given signer credential(s).
|
CryptoResult<UnsealedData> unseal(byte[] data)
data - - the sealed messageCryptoResult<UnsealedData> unseal(byte[] data, SigningCredential... signers)
data - - the sealed messagesigners - - credential(s) of expected signerCryptoResult<UnsealedData> unseal(byte[] data, javax.crypto.SecretKey kek)
data - - the sealed messagekek - - the Key Encryption Key by which the data can get decrypted.CryptoResult<UnsealedData> unseal(byte[] data, javax.crypto.SecretKey kek, SigningCredential... signers)
data - - the sealed messagekek - - the Key Encryption Key by which the data can get decrypted.signers - - credential(s) of expected signerCryptoResult<UnsealedData> unseal(java.io.InputStream sealedData, java.io.OutputStream unsealedData)
sealedData - - the sealed messageunsealedData - - the unsealed data is written to this OutputStreamCryptoResult<UnsealedData> unseal(java.io.InputStream sealedData, java.io.OutputStream unsealedData, SigningCredential... signers)
sealedData - - the sealed messageunsealedData - - the unsealed data is written to this OutputStreamsigners - - credential(s) of expected signerCryptoResult<UnsealedData> unseal(java.io.InputStream sealedData, java.io.OutputStream unsealedData, javax.crypto.SecretKey kek)
sealedData - - the sealed messageunsealedData - - the unsealed data is written to this OutputStreamkek - - the Key Encryption Key by which the data can get decrypted.CryptoResult<UnsealedData> unseal(java.io.InputStream sealedData, java.io.OutputStream unsealedData, javax.crypto.SecretKey kek, SigningCredential... signers)
sealedData - - the sealed messageunsealedData - - the unsealed data is written to this OutputStreamkek - - the Key Encryption Key by which the data can get decrypted.signers - - credential(s) of expected signerjava.lang.String getKekID(byte[] sealedData)
sealedData - - the sealed messagejava.lang.RuntimeException - if the sealed data is not conform the eHealth ETEE spec (SignedData/EnvelopedData/SignedData, EnvelopedData
with 0 or 1 KEKRecipientInfos).java.lang.String getSubjectKeyIdentifier(byte[] sealedData)
sealedData - - the sealed messagejava.lang.RuntimeException - if the sealed data is not conform the eHealth ETEE spec (SignedData/EnvelopedData/SignedData).Copyright © 2021 eHealth. All rights reserved.