[java-opensaml COMMIT] in /trunk: opensaml-security-api/pom.xml opensaml-security-api/src/main/java/org/opensaml/secu...
noreply at shibboleth.net
noreply at shibboleth.net
Wed Mar 12 15:53:12 EDT 2014
Author: dfisher
Date: Wed Mar 12 15:53:12 2014
New Revision: 3688
URL: http://svn.shibboleth.net/view/java-opensaml?rev=3688&view=rev
Log:
Replace vt-crypt dependency with cryptacular.
Update bouncycastle version to 1.50.
Fix usage of changed or deprecated BC classes.
Modified:
trunk/opensaml-security-api/pom.xml
trunk/opensaml-security-api/src/main/java/org/opensaml/security/crypto/KeySupport.java
trunk/opensaml-security-api/src/main/java/org/opensaml/security/x509/X509Support.java
trunk/opensaml-storage-impl/pom.xml
trunk/opensaml-xmlsec-impl/src/test/java/org/opensaml/xmlsec/keyinfo/impl/KeyInfoGeneratorManagerTest.java
trunk/opensaml-xmlsec-impl/src/test/java/org/opensaml/xmlsec/keyinfo/impl/NamedKeyInfoGeneratorManagerTest.java
Modified: trunk/opensaml-security-api/pom.xml
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-security-api/pom.xml?rev=3688&r1=3687&r2=3688&view=diff
==============================================================================
--- trunk/opensaml-security-api/pom.xml (original)
+++ trunk/opensaml-security-api/pom.xml Wed Mar 12 15:53:12 2014
@@ -29,13 +29,13 @@
</dependency>
<dependency>
- <groupId>edu.vt.middleware</groupId>
- <artifactId>vt-crypt</artifactId>
+ <groupId>org.cryptacular</groupId>
+ <artifactId>cryptacular</artifactId>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
- <artifactId>bcprov-jdk15</artifactId>
+ <artifactId>bcprov-jdk15on</artifactId>
</dependency>
<!-- Provided Dependencies -->
@@ -57,4 +57,4 @@
</dependencies>
-</project>
+</project>
Modified: trunk/opensaml-security-api/src/main/java/org/opensaml/security/crypto/KeySupport.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-security-api/src/main/java/org/opensaml/security/crypto/KeySupport.java?rev=3688&r1=3687&r2=3688&view=diff
==============================================================================
--- trunk/opensaml-security-api/src/main/java/org/opensaml/security/crypto/KeySupport.java (original)
+++ trunk/opensaml-security-api/src/main/java/org/opensaml/security/crypto/KeySupport.java Wed Mar 12 15:53:12 2014
@@ -17,7 +17,6 @@
package org.opensaml.security.crypto;
-import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.math.BigInteger;
@@ -56,14 +55,12 @@
import net.shibboleth.utilities.java.support.collection.LazyMap;
import net.shibboleth.utilities.java.support.logic.Constraint;
+import org.cryptacular.util.KeyPairUtil;
import org.opensaml.security.SecurityException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.io.Files;
-
-import edu.vt.middleware.crypt.CryptException;
-import edu.vt.middleware.crypt.io.PrivateKeyCredentialReader;
/**
* Helper methods for cryptographic keys and key pairs.
@@ -184,20 +181,12 @@
@Nonnull public static PrivateKey decodePrivateKey(@Nonnull final byte[] key, @Nullable final char[] password)
throws KeyException {
Constraint.isNotNull(key, "Encoded key bytes cannot be null");
-
- PrivateKeyCredentialReader credReader = new PrivateKeyCredentialReader();
- ByteArrayInputStream bais = new ByteArrayInputStream(key);
- try {
- if (password != null && password.length > 0) {
- return credReader.read(bais, password);
- } else {
- return credReader.read(bais);
- }
- } catch (IOException e) {
- throw new KeyException("Unable to decode private key", e);
- } catch (CryptException e) {
- throw new KeyException("Unable to decode private key", e);
- }
+
+ if (password != null && password.length > 0) {
+ return KeyPairUtil.decodePrivateKey(key, password);
+ } else {
+ return KeyPairUtil.decodePrivateKey(key);
+ }
}
/**
Modified: trunk/opensaml-security-api/src/main/java/org/opensaml/security/x509/X509Support.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-security-api/src/main/java/org/opensaml/security/x509/X509Support.java?rev=3688&r1=3687&r2=3688&view=diff
==============================================================================
--- trunk/opensaml-security-api/src/main/java/org/opensaml/security/x509/X509Support.java (original)
+++ trunk/opensaml-security-api/src/main/java/org/opensaml/security/x509/X509Support.java Wed Mar 12 15:53:12 2014
@@ -30,7 +30,6 @@
import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
-import java.security.cert.CertificateParsingException;
import java.security.cert.X509CRL;
import java.security.cert.X509Certificate;
import java.util.Arrays;
@@ -46,15 +45,19 @@
import net.shibboleth.utilities.java.support.logic.Constraint;
[... 328 lines stripped ...]
More information about the commits
mailing list