diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2014-07-25 11:43:42 +0400 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2014-07-25 11:43:42 +0400 |
commit | 42e43cf4310c95209ad496b98604ef4e5f998502 (patch) | |
tree | f72a42980c77dd4e524563ca67a4590a2c20437c | |
parent | 583195647c8499f003f0769d912d4dbe39ac17b3 (diff) | |
parent | ccdce8cdd5ef48710da0b38d09c323761199c7da (diff) |
Merge branch 'master' of git.bouncycastle.org:bc-java
-rw-r--r-- | pkix/src/main/j2me/org/bouncycastle/cms/CMSAuthenticatedGenerator.java | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/pkix/src/main/j2me/org/bouncycastle/cms/CMSAuthenticatedGenerator.java b/pkix/src/main/j2me/org/bouncycastle/cms/CMSAuthenticatedGenerator.java new file mode 100644 index 00000000..7749a6c3 --- /dev/null +++ b/pkix/src/main/j2me/org/bouncycastle/cms/CMSAuthenticatedGenerator.java @@ -0,0 +1,41 @@ +package org.bouncycastle.cms; + +import java.util.HashMap; +import java.util.Map; + +import org.bouncycastle.asn1.ASN1ObjectIdentifier; +import org.bouncycastle.asn1.x509.AlgorithmIdentifier; +import org.bouncycastle.util.Arrays; + +public class CMSAuthenticatedGenerator + extends CMSEnvelopedGenerator +{ + protected CMSAttributeTableGenerator authGen; + protected CMSAttributeTableGenerator unauthGen; + + /** + * base constructor + */ + public CMSAuthenticatedGenerator() + { + } + + public void setAuthenticatedAttributeGenerator(CMSAttributeTableGenerator authGen) + { + this.authGen = authGen; + } + + public void setUnauthenticatedAttributeGenerator(CMSAttributeTableGenerator unauthGen) + { + this.unauthGen = unauthGen; + } + + protected Map getBaseParameters(ASN1ObjectIdentifier contentType, AlgorithmIdentifier digAlgId, byte[] hash) + { + Map param = new HashMap(); + param.put(CMSAttributeTableGenerator.CONTENT_TYPE, contentType); + param.put(CMSAttributeTableGenerator.DIGEST_ALGORITHM_IDENTIFIER, digAlgId); + param.put(CMSAttributeTableGenerator.DIGEST, Arrays.clone(hash)); + return param; + } +} |