|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DataSealer
A DataSealer is a thread safe object that can protect data that must be exchanged between two parties. It provides protection regarding the following aspects of the data:
A DataSealer has a strong association with an author, because it signs data with the private authentication key of the author
Consequently a DataSealer must be created for each author. Use the DataSealerBuilder to create DataSealers. Once the DataSealer
is created, it can be used for several messages, to different addressees. It can be used simultaniously by multiple threads.
To seal the data, i.e. protect the data, you need to pass to the seal operation :
The KEK ID will be readible included in the sealed message. In other words, the KEK ID is not encrypted. As such it can be used by the recipient to know which KEK to fetch from the KGSS (Kek Generation and Storage Service) in order to decrypt the sealed message. In some circumstances, you don't want to have the real identifier of the symmetric KEK of the message in the message. In that case you can pass a dummy value as KEK ID to the seal operation, and use another way of letting your recipient know which KEK to use to decrypt the message.
The dataToSeal can be a byte[] or an InputStream. Use the byte[] for small messages that can be loaded in memory in one take. Use the
InputStream for bigger messages.
The result of a seal operation of the DataSealer is a CMS message according to the security policy of the eHealth Platform Belgium
regarding End-To-End protection of data to exchange.
Note that one CMS message can have the data sealed for multiple addressees. In that case a Set of EncryptionTokens must be passed to the
seal operation.
DataSealerBuilder,
EncryptionToken| Method Summary | |
|---|---|
byte[] |
seal(byte[] dataToSeal,
javax.crypto.SecretKey symKek,
java.lang.String base64encodedSymKekId)
Seals the given data so that it can be exchanged safely to the unknown addressee(s) who has access to the SecretKey. |
byte[] |
seal(EncryptionToken etk,
byte[] dataToSeal)
Seals the given data so that it can be exchanged safely to the owner of the given EncryptionToken. |
byte[] |
seal(EncryptionToken asymKek,
byte[] dataToSeal,
javax.crypto.SecretKey symKek,
java.lang.String base64encodedSymKekId)
Seals the given data so that it can be exchanged safely to the owner of the given EncryptionToken and to the unknown addressee who has access to the SecretKey. |
void |
seal(EncryptionToken asymKek,
java.io.InputStream dataToSeal,
java.io.OutputStream sealedData)
Seals a given message for a known addressee. |
void |
seal(EncryptionToken asymKek,
java.io.InputStream dataToSeal,
java.io.OutputStream sealedData,
javax.crypto.SecretKey symKek,
java.lang.String base64encodedSymKekId)
Seals a given message for a known addressee and for unknown addressee(s) who have access to the secret key. |
void |
seal(java.io.InputStream dataToSeal,
java.io.OutputStream sealedData,
javax.crypto.SecretKey symKek,
java.lang.String base64encodedSymKekId)
Seals a given message for unknown addressee(s) who have access to the secret key. |
byte[] |
seal(java.util.Set<EncryptionToken> asymKeks,
byte[] dataToSeal)
Seals the given data so that it can be exchanged safely to the owners of the given EncryptionTokens. |
byte[] |
seal(java.util.Set<EncryptionToken> asymKeks,
byte[] dataToSeal,
javax.crypto.SecretKey symKek,
java.lang.String base64encodedSymKekId)
Seals the given data so that it can be exchanged safely to the owners of the given EncryptionTokens and to the unknown addressee(s) who has access to the SecretKey. |
void |
seal(java.util.Set<EncryptionToken> asymKeks,
java.io.InputStream dataToSeal,
java.io.OutputStream sealedData)
Seals a given message for a set of known addressees. |
void |
seal(java.util.Set<EncryptionToken> asymKeks,
java.io.InputStream dataToSeal,
java.io.OutputStream sealedData,
javax.crypto.SecretKey symKek,
java.lang.String base64encodedSymKekId)
Seals a given message for a set of known addressees and for unknown addressee(s) who have access to the secret key. |
| Method Detail |
|---|
byte[] seal(EncryptionToken etk,
byte[] dataToSeal)
throws DataSealerException
dataToSeal - - the data to sealetk - - the EncryptionToken of the addresee
DataSealerException - When the CMS message could not be generated.
byte[] seal(EncryptionToken asymKek,
byte[] dataToSeal,
javax.crypto.SecretKey symKek,
java.lang.String base64encodedSymKekId)
throws DataSealerException
asymKek - - the EncryptionToken of a recipient.dataToSeal - - the data to sealsymKek - - the symmetric Key Encryption Keybase64encodedSymKekId - - the ID (base64 encoded) of the given SecretKey symKek
DataSealerException - When the CMS message could not be generated.
byte[] seal(java.util.Set<EncryptionToken> asymKeks,
byte[] dataToSeal)
throws DataSealerException
dataToSeal - - the data to sealasymKeks - - the EncryptionTokens of the addressees
DataSealerException - When the CMS message could not be generated.
byte[] seal(java.util.Set<EncryptionToken> asymKeks,
byte[] dataToSeal,
javax.crypto.SecretKey symKek,
java.lang.String base64encodedSymKekId)
throws DataSealerException
asymKeks - - the EncryptionTokens of the addresseesdataToSeal - - the data to sealsymKek - - the symmetric Key Encryption Keybase64encodedSymKekId - - the ID (base64 encoded) of the given SecretKey symKek
DataSealerException - When the CMS message could not be generated.
byte[] seal(byte[] dataToSeal,
javax.crypto.SecretKey symKek,
java.lang.String base64encodedSymKekId)
throws DataSealerException
dataToSeal - - the data to sealsymKek - - the symmetric Key Encryption Keybase64encodedSymKekId - - the ID (base64 encoded) of the given SecretKey symKek
DataSealerException - When the CMS message could not be generated.
void seal(EncryptionToken asymKek,
java.io.InputStream dataToSeal,
java.io.OutputStream sealedData)
throws DataSealerException
asymKek - - the EncryptionToken of a recipient.dataToSeal - the InputStream where the dataToSeal content is read from by the DataSealer. The given InputStream must implement
the available() method.sealedData - the OutputStream to which the sealed result is written by the DataSealer. When the sealing is finished, the
OutputStream is not closed in here.
DataSealerException - When the CMS message could not be generated.
void seal(java.util.Set<EncryptionToken> asymKeks,
java.io.InputStream dataToSeal,
java.io.OutputStream sealedData)
throws DataSealerException
asymKeks - - the EncryptionTokens of the known addresseesdataToSeal - the InputStream where the dataToSeal content is read from by the DataSealer. The given InputStream must implement
the available() method.sealedData - the OutputStream to which the sealed result is written by the DataSealer. When the sealing is finished, the
OutputStream is not closed in here.
DataSealerException - When the CMS message could not be generated.
void seal(EncryptionToken asymKek,
java.io.InputStream dataToSeal,
java.io.OutputStream sealedData,
javax.crypto.SecretKey symKek,
java.lang.String base64encodedSymKekId)
throws DataSealerException
asymKek - - the EncryptionToken of a recipient.dataToSeal - the InputStream where the dataToSeal content is read from by the DataSealer. The given InputStream must implement
the available() method.sealedData - the OutputStream to which the sealed result is written by the DataSealer. When the sealing is finished, the
OutputStream is not closed in here.symKek - - the symmetric Key Encryption Keybase64encodedSymKekId - - the ID (base64 encoded) of the given SecretKey symKek
DataSealerException - When the CMS message could not be generated.
void seal(java.util.Set<EncryptionToken> asymKeks,
java.io.InputStream dataToSeal,
java.io.OutputStream sealedData,
javax.crypto.SecretKey symKek,
java.lang.String base64encodedSymKekId)
throws DataSealerException
asymKeks - - the EncryptionTokens of the known addresseesdataToSeal - the InputStream where the dataToSeal content is read from by the DataSealer. The given InputStream must implement
the available() method.sealedData - the OutputStream to which the sealed result is written by the DataSealer. When the sealing is finished, the
OutputStream is not closed in here.symKek - - the symmetric Key Encryption Keybase64encodedSymKekId - - the ID (base64 encoded) of the given SecretKey symKek
DataSealerException - When the CMS message could not be generated.
void seal(java.io.InputStream dataToSeal,
java.io.OutputStream sealedData,
javax.crypto.SecretKey symKek,
java.lang.String base64encodedSymKekId)
throws DataSealerException
dataToSeal - the InputStream where the dataToSeal content is read from by the DataSealer. The given InputStream must implement
the available() method.sealedData - the OutputStream to which the sealed result is written by the DataSealer. When the sealing is finished, the
OutputStream is not closed in here.symKek - - the symmetric Key Encryption Keybase64encodedSymKekId - - the ID (base64 encoded) of the given SecretKey symKek
DataSealerException - When the CMS message could not be generated.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||