|
IAIK High-Level API version 1.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object iaik.hlapi.DecrypterVerifier iaik.hlapi.CMSDecrypterVerifier
public class CMSDecrypterVerifier
This class decrypts CMS enveloped data objects and verifies CMS signed data objects.
It supports a signed data object that is nested inside an enveloped data object. If present it checks these signed attributes for consistency: content type, signing time, message digest and signing certificate (v1 and v2).
The input must be a DER encoded CMS ContentInfo structure.
Constructor Summary | |
---|---|
CMSDecrypterVerifier()
Create a new object for decrypting and verifying CMS enveloped data and signed data objects. |
Method Summary | |
---|---|
void |
dropDecryptionKeys()
Release all references to any previously set decryption keys. |
Date |
getSigningTime()
Get the signing time which was encoded as a signed property in the signature object. |
InputStream |
process(InputStream data)
Decrypt and/or verify the given data. |
void |
registerDecryptionKey(KeyAndCertificate decryptionKey)
Register a key to be a decryption key for the associated certificate. |
Methods inherited from class iaik.hlapi.DecrypterVerifier |
---|
process, verify |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CMSDecrypterVerifier()
Method Detail |
---|
public void registerDecryptionKey(KeyAndCertificate decryptionKey) throws HlApiException
DecrypterVerifier
The certificate in the decryptionKey
may be null
.
In this case, the decryption method will try to use this key for
decrypting the data. However, it is recommended to provide the
certificate that belongs to the private key.
registerDecryptionKey
in class DecrypterVerifier
decryptionKey
- The decryption key and the certificate.
HlApiException
- If handling the certificate fails.public void dropDecryptionKeys()
DecrypterVerifier
dropDecryptionKeys
in class DecrypterVerifier
public InputStream process(InputStream data) throws IOException, NoKeyException, HlApiException
DecrypterVerifier
If the data is encrypted, a suitable decryption keys must have been registered
before using DecrypterVerifier.registerDecryptionKey(KeyAndCertificate)
.
process
in class DecrypterVerifier
data
- The stream that provides the encrypted and/or signed data.
IOException
- If reading from the given stream fails.
NoKeyException
- If there is no suitable key available for decryption.
HlApiException
- If decryption or verification fails.public Date getSigningTime() throws HlApiException
DecrypterVerifier
getSigningTime
in class DecrypterVerifier
null
if there was no signing time
encoded in the signed data or if there was no signature.
HlApiException
- If parsing the signing time out of the signature
structure fails.
|
IAIK High-Level API version 1.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2007,
IAIK, Graz University of Technology Copyright © 2007, Stiftung SIC |