项目OIOSAML使用Bouncy Castle API,由Apache Ivy管理。

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"/>
...


我使用具有相同依赖项的Maven。 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>
...


但是,我在subjectKeyIdentifier类中找不到字段authorityKeyIdentifierX509Extension

SecurityHelper类的一部分:

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类:

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 */ }
}


要使用OIOSAML,需要使用哪个版本的Bouncy Castle API?

最佳答案

这是org.bouncycastle-bcprov-jdk15.jar

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

08-04 10:04