public class HMACwith3DESAuthenticatedDataDemo extends AuthenticatedDataDemo
AuthenticatedDataStream
and
AuthenticatedData
for recipient-specific protecting the
integrity of a message using the CMS type AuthenticatedData with the
HMACwith3DESwrap
algorithm for wrapping the HMAC key.
Attention: This demo uses Static-Static Diffie-Hellman as key management technique for providing origin authentication. The mac key is wrapped by using the HMACwith3DESwrap algorithm as specified by RFC 3537.
This demo requires that you have iaik_esdh.jar
(or iaik_jce_full.jar
) in your classpath.
You can download it from
https://sic.tech/products/core-crypto-toolkits/jca-jce/.
AuthenticatedDataStream
,
AuthenticatedData
Constructor and Description |
---|
HMACwith3DESAuthenticatedDataDemo()
Creates an HMACwith3DESAuthenticatedDataDemo and setups the demo certificates.
|
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] argv)
Main method.
|
createAuthenticatedData, createAuthenticatedDataStream, createRecipients, getAuthenticatedData, getAuthenticatedData, getAuthenticatedData, getAuthenticatedDataStream, getAuthenticatedDataStream, getAuthenticatedDataStream, parseAuthenticatedDataWithRecipientCertOrKEKId, parseAuthenticatedDataWithRecipientIdentifier, parseAuthenticatedDataWithRecipientInfoIndex, start
public HMACwith3DESAuthenticatedDataDemo() throws java.io.IOException, java.security.NoSuchAlgorithmException
SetupCMSKeyStore
.
java.io.IOException
- if an file read error occursjava.security.NoSuchAlgorithmException
- if no implementation for the requested key wrap algorithm is availablepublic static void main(java.lang.String[] argv) throws java.lang.Exception
java.io.IOException
- if an I/O error occurs when reading required keys
and certificates from filesjava.lang.Exception