Skip to content

Commit f36678b

Browse files
author
jester
committed
Adding Options for key encryption and key digest algorithms.
This is a back port for the OAEP feature added to 8.1.0 RI.
1 parent ba8e952 commit f36678b

File tree

4 files changed

+33
-7
lines changed

4 files changed

+33
-7
lines changed

pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<artifactId>direct-common</artifactId>
66
<name>Direct Project common APIs</name>
7-
<version>6.0.1</version>
7+
<version>6.1.0-SNAPSHOT</version>
88
<description>Direct Project common APIs. Includes instrumentation, auditing, and other utility APIs</description>
99
<inceptionYear>2010</inceptionYear>
1010
<url>http://api.nhindirect.org/x/www/api.nhindirect.org/java/site/direct-common/${project.version}</url>
@@ -125,13 +125,13 @@
125125
</dependency>
126126
<dependency>
127127
<groupId>org.bouncycastle</groupId>
128-
<artifactId>bcprov-jdk15on</artifactId>
129-
<version>1.60</version>
128+
<artifactId>bcprov-jdk18on</artifactId>
129+
<version>1.81</version>
130130
</dependency>
131131
<dependency>
132132
<groupId>org.bouncycastle</groupId>
133-
<artifactId>bcmail-jdk15on</artifactId>
134-
<version>1.60</version>
133+
<artifactId>bcmail-jdk18on</artifactId>
134+
<version>1.81</version>
135135
</dependency>
136136
<dependency>
137137
<groupId>org.springframework.boot</groupId>

src/main/java/org/nhindirect/common/crypto/tools/commands/PKCS11Commands.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ else if (keyUsage.compareToIgnoreCase("DigitalSignature") == 0)
642642

643643
final ASN1EncodableVector attributes = new ASN1EncodableVector();
644644
final Attribute attribute = new Attribute(PKCSObjectIdentifiers.pkcs_9_at_extensionRequest,
645-
new DERSet(exts.toASN1Object()));
645+
new DERSet(exts.toASN1Primitive()));
646646

647647
attributes.add(attribute);
648648

src/main/java/org/nhindirect/common/options/OptionsManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ public class OptionsManager
107107
*/
108108
JVM_PARAMS.put(OptionsParameter.CRYPTOGRAHPER_SMIME_ENCRYPTION_ALGORITHM, "org.nhindirect.stagent.cryptographer.smime.EncryptionAlgorithm");
109109
JVM_PARAMS.put(OptionsParameter.CRYPTOGRAHPER_SMIME_DIGEST_ALGORITHM, "org.nhindirect.stagent.cryptographer.smime.DigestAlgorithm");
110+
JVM_PARAMS.put(OptionsParameter.CRYPTOGRAHPER_KEY_ENCRYPTION_ALGORITHM, "org.nhindirect.stagent.cryptographer.smime.KeyEncryptionAlgorithm");
111+
JVM_PARAMS.put(OptionsParameter.CRYPTOGRAHPER_KEY_ENCRYPTION_DIGEST_ALGORITHM, "org.nhindirect.stagent.cryptographer.smime.KeyEncryptionDigestAlgorithm");
110112
JVM_PARAMS.put(OptionsParameter.ENFORCE_STRONG_DIGESTS, "org.nhindirect.stagent.cryptographer.smime.EnforceStrongDigests");
111113
JVM_PARAMS.put(OptionsParameter.ENFORCE_STRONG_ENCRYPTION, "org.nhindirect.stagent.cryptographer.smime.EnforceStrongEncryption");
112114
JVM_PARAMS.put(OptionsParameter.CRYPTOGRAHPER_LOG_DIGESTS, "org.nhindirect.stagent.cryptographer.smime.LogDigests");

src/main/java/org/nhindirect/common/options/OptionsParameter.java

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,31 @@ public class OptionsParameter
158158
* <p><b>JVM Parameter/Options Name:</b> org.nhindirect.stagent.cryptographer.smime.EncryptionAlgorithm
159159
*/
160160
public final static String CRYPTOGRAHPER_SMIME_ENCRYPTION_ALGORITHM = "CRYPTOGRAHPER_SMIME_ENCRYPTION_ALGORITHM";
161-
161+
162+
/**
163+
* String value that specifies the key encryption algorithm used to encrypt message keys by the SMIME cryptographer
164+
* <br>Valid option values:
165+
* <ul>
166+
* <li>RSA_OAEP</li>
167+
* <li>RSA_PKCS#1V15</li>
168+
* </ul>
169+
* <p><b>JVM Parameter/Options Name:</b> org.nhindirect.stagent.cryptographer.smime.EncryptionAlgorithm
170+
*/
171+
public final static String CRYPTOGRAHPER_KEY_ENCRYPTION_ALGORITHM = "CRYPTOGRAHPER_KEY_ENCRYPTION_ALGORITHM";
172+
173+
/**
174+
* String value that specifies the key encryption algorithm used to encrypt message keys by the SMIME cryptographer
175+
* <br>Valid option values:
176+
* <ul>
177+
* <li>SHA1</li>
178+
* <li>SHA256</li>
179+
* <li>SHA384</li>
180+
* <li>SHA512</li>
181+
* </ul>
182+
* <p><b>JVM Parameter/Options Name:</b> org.nhindirect.stagent.cryptographer.smime.EncryptionAlgorithm
183+
*/
184+
public final static String CRYPTOGRAHPER_KEY_ENCRYPTION_DIGEST_ALGORITHM = "CRYPTOGRAHPER_KEY_ENCRYPTION_DIGEST_ALGORITHM";
185+
162186
/**
163187
* String value that specifies the digest algorithm used to hash messages by the SMIME cryptographer
164188
* <br>Valid option values:

0 commit comments

Comments
 (0)