IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1

demo.cms.authenticatedData
Class HMACwithAESAuthenticatedDataDemo

java.lang.Object
  extended by demo.cms.authenticatedData.AuthenticatedDataDemo
      extended by demo.cms.authenticatedData.HMACwithAESAuthenticatedDataDemo

public class HMACwithAESAuthenticatedDataDemo
extends AuthenticatedDataDemo

Demonstrates the usage of class AuthenticatedDataStream and AuthenticatedData for recipient-specific protecting the integrity of a message using the CMS type AuthenticatedData with the HMACwithAESwrap 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 HMACwithAESwrap 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/.

See Also:
AuthenticatedDataStream, AuthenticatedData

Constructor Summary
HMACwithAESAuthenticatedDataDemo()
          Creates an HMACwithAESAuthenticatedDataDemo and setups the demo certificates.
 
Method Summary
static void main(java.lang.String[] argv)
          Main method.
 
Methods inherited from class demo.cms.authenticatedData.AuthenticatedDataDemo
createAuthenticatedData, createAuthenticatedDataStream, createRecipients, getAuthenticatedData, getAuthenticatedData, getAuthenticatedData, getAuthenticatedDataStream, getAuthenticatedDataStream, getAuthenticatedDataStream, parseAuthenticatedDataWithRecipientCertOrKEKId, parseAuthenticatedDataWithRecipientIdentifier, parseAuthenticatedDataWithRecipientInfoIndex, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HMACwithAESAuthenticatedDataDemo

public HMACwithAESAuthenticatedDataDemo()
                                 throws java.io.IOException,
                                        java.security.NoSuchAlgorithmException
Creates an HMACwithAESAuthenticatedDataDemo and setups the demo certificates.
Keys and certificates are retrieved from the demo KeyStore ("cms.keystore") file which has to be located in your current working directory and may be created by running SetupCMSKeyStore.
HMACwithAESwrap is used as key wrap algorithm.

Throws:
java.io.IOException - if an file read error occurs
java.security.NoSuchAlgorithmException - if no implementation for the requested key wrap algorithm is available
Method Detail

main

public static void main(java.lang.String[] argv)
                 throws java.lang.Exception
Main method.

Throws:
java.io.IOException - if an I/O error occurs when reading required keys and certificates from files
java.lang.Exception

IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1

v6.1
(c) 2002 IAIK, (c) 2003 - 2025 SIC