[java-opensaml COMMIT] in /trunk: opensaml-security-api/src/main/java/org/opensaml/security/x509/X509Support.java ope...
noreply at shibboleth.net
noreply at shibboleth.net
Mon Apr 16 22:41:01 BST 2012
Author: putmanb
Date: Mon Apr 16 22:41:01 2012
New Revision: 3038
URL: http://svn.shibboleth.net/view/java-opensaml?rev=3038&view=rev
Log:
Some Checkstyle and other cleanup to some support classes.
Modified:
trunk/opensaml-security-api/src/main/java/org/opensaml/security/x509/X509Support.java
trunk/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/crypto/AlgorithmSupport.java
trunk/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/keyinfo/KeyInfoSupport.java
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=3038&r1=3037&r2=3038&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 Mon Apr 16 22:41:01 2012
@@ -68,11 +68,6 @@
*/
public class X509Support {
- /** Encoding used to store a key or certificate in a file. */
- public static enum ENCODING_FORMAT {
- PEM, DER
- };
-
/** Common Name (CN) OID. */
public static final String CN_OID = "2.5.4.3";
Modified: trunk/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/crypto/AlgorithmSupport.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/crypto/AlgorithmSupport.java?rev=3038&r1=3037&r2=3038&view=diff
==============================================================================
--- trunk/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/crypto/AlgorithmSupport.java (original)
+++ trunk/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/crypto/AlgorithmSupport.java Mon Apr 16 22:41:01 2012
@@ -187,9 +187,9 @@
* @return a basic credential containing a randomly generated symmetric key
* @throws KeyException
* @throws NoSuchAlgorithmException algorithm not found
- * @throws NoSuchProviderException provider not found
- */
- public static Credential generateSymmetricKeyAndCredential(String algorithmURI) throws NoSuchAlgorithmException, KeyException {
+ */
+ public static Credential generateSymmetricKeyAndCredential(String algorithmURI)
+ throws NoSuchAlgorithmException, KeyException {
SecretKey key = generateSymmetricKey(algorithmURI);
BasicCredential credential = new BasicCredential(key);
return credential;
Modified: trunk/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/keyinfo/KeyInfoSupport.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/keyinfo/KeyInfoSupport.java?rev=3038&r1=3037&r2=3038&view=diff
==============================================================================
--- trunk/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/keyinfo/KeyInfoSupport.java (original)
+++ trunk/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/keyinfo/KeyInfoSupport.java Mon Apr 16 22:41:01 2012
@@ -36,7 +36,6 @@
import java.security.spec.InvalidKeySpecException;
import java.security.spec.KeySpec;
import java.security.spec.RSAPublicKeySpec;
-import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
@@ -262,7 +261,6 @@
* @return a native Java {@link java.security.cert.X509CRL} object
*
* @throws CRLException thrown if there is a problem converting the CRL data into {@link java.security.cert.X509CRL}
- * s
*/
public static X509CRL getCRL(org.opensaml.xmlsec.signature.X509CRL xmlCRL) throws CRLException {
@@ -270,8 +268,11 @@
return null;
}
- Collection<X509CRL> crls = X509Support.decodeCRLs(Base64Support.decode(xmlCRL.getValue()));
- return crls.iterator().next();
+ try {
+ return X509Support.decodeCRL(xmlCRL.getValue());
+ } catch (CertificateException e) {
+ throw new CRLException("Certificate error attempting to decode CRL", e);
+ }
}
/**
@@ -287,8 +288,8 @@
X509Data x509Data;
if (keyInfo.getX509Datas().size() == 0) {
x509Data =
- (X509Data) XMLObjectProviderRegistrySupport.getBuilderFactory().getBuilder(X509Data.DEFAULT_ELEMENT_NAME)
- .buildObject(X509Data.DEFAULT_ELEMENT_NAME);
+ (X509Data) XMLObjectProviderRegistrySupport.getBuilderFactory()
+ .getBuilder(X509Data.DEFAULT_ELEMENT_NAME).buildObject(X509Data.DEFAULT_ELEMENT_NAME);
keyInfo.getX509Datas().add(x509Data);
} else {
x509Data = keyInfo.getX509Datas().get(0);
@@ -309,8 +310,8 @@
X509Data x509Data;
if (keyInfo.getX509Datas().size() == 0) {
x509Data =
- (X509Data) XMLObjectProviderRegistrySupport.getBuilderFactory().getBuilder(X509Data.DEFAULT_ELEMENT_NAME)
[... 70 lines stripped ...]
More information about the commits
mailing list