Search code examples
javamavenbouncycastlesaml-2.0opensaml

Bouncy Castle Maven dependencies for OIOSAML


Project OIOSAML uses Bouncy Castle API, managed by Apache Ivy.

Part of ivi.xml:

...
<dependency org="org.bouncycastle" name="bcprov-jdk15on" rev="1.49" conf="*->*,!sources,!javadoc"/>
<dependency org="org.bouncycastle" name="bcpkix-jdk15on" rev="1.49" conf="*->*,!sources,!javadoc"/>
...

I use Maven with the same dependencies. Part of pom.xml:

...
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-jdk15on</artifactId>
    <version>1.49</version>
</dependency>

<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcpkix-jdk15on</artifactId>
    <version>1.49</version>
</dependency>
...

However, I can't found fields subjectKeyIdentifier and authorityKeyIdentifier in X509Extension class.

Part of SecurityHelper class:

package dk.itst.oiosaml.security;

public class SecurityHelper {
...
    public static X509Certificate generateCertificate(Credential credential, String entityId) throws Exception {
        ...
        gen.addExtension(X509Extension.subjectKeyIdentifier, false, new JcaX509ExtensionUtils().createSubjectKeyIdentifier(credential.getPublicKey()));
        gen.addExtension(X509Extension.authorityKeyIdentifier, false, new JcaX509ExtensionUtils().createAuthorityKeyIdentifier(credential.getPublicKey()));
        ...
    }
}

X509Extension class:

package org.bouncycastle.asn1.x509;

public class X509Extension {
    boolean critical;
    org.bouncycastle.asn1.ASN1OctetString value;

    public X509Extension(org.bouncycastle.asn1.DERBoolean derBoolean, org.bouncycastle.asn1.ASN1OctetString asn1OctetString) { /* compiled code */ }

    public X509Extension(boolean b, org.bouncycastle.asn1.ASN1OctetString asn1OctetString) { /* compiled code */ }

    public boolean isCritical() { /* compiled code */ }

    public org.bouncycastle.asn1.ASN1OctetString getValue() { /* compiled code */ }

    public int hashCode() { /* compiled code */ }

    public boolean equals(java.lang.Object o) { /* compiled code */ }

    public static org.bouncycastle.asn1.ASN1Object convertValueToObject(org.bouncycastle.asn1.x509.X509Extension x509Extension) throws java.lang.IllegalArgumentException { /* compiled code */ }
}

Which version of Bouncy Castle API need to use to work with OIOSAML?


Solution

  • It's org.bouncycastle-bcprov-jdk15.jar

    <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcprov-jdk15</artifactId>
        <version>1.46</version>
    </dependency>