summaryrefslogtreecommitdiffstats
path: root/bcpkix/src/main/java/org/bouncycastle/cms/CMSAuthenticatedGenerator.java
diff options
context:
space:
mode:
Diffstat (limited to 'bcpkix/src/main/java/org/bouncycastle/cms/CMSAuthenticatedGenerator.java')
-rw-r--r--bcpkix/src/main/java/org/bouncycastle/cms/CMSAuthenticatedGenerator.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/bcpkix/src/main/java/org/bouncycastle/cms/CMSAuthenticatedGenerator.java b/bcpkix/src/main/java/org/bouncycastle/cms/CMSAuthenticatedGenerator.java
new file mode 100644
index 0000000..6aadf1e
--- /dev/null
+++ b/bcpkix/src/main/java/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;
+ }
+}