|
42 | 42 | import javax.security.auth.x500.X500Principal; |
43 | 43 |
|
44 | 44 | import org.bouncycastle.asn1.ASN1Encodable; |
45 | | -import org.bouncycastle.asn1.ASN1Encoding; |
46 | 45 | import org.bouncycastle.asn1.ASN1Enumerated; |
47 | 46 | import org.bouncycastle.asn1.ASN1GeneralizedTime; |
48 | 47 | import org.bouncycastle.asn1.ASN1Integer; |
|
55 | 54 | import org.bouncycastle.asn1.x500.X500Name; |
56 | 55 | import org.bouncycastle.asn1.x500.style.RFC4519Style; |
57 | 56 | import org.bouncycastle.asn1.x509.AlgorithmIdentifier; |
58 | | -import org.bouncycastle.asn1.x509.AuthorityKeyIdentifier; |
59 | 57 | import org.bouncycastle.asn1.x509.CRLDistPoint; |
60 | 58 | import org.bouncycastle.asn1.x509.CRLReason; |
61 | 59 | import org.bouncycastle.asn1.x509.DistributionPoint; |
@@ -1234,25 +1232,26 @@ static Collection findIssuerCerts( |
1234 | 1232 | "Subject criteria for certificate selector to find issuer certificate could not be set.", e); |
1235 | 1233 | } |
1236 | 1234 |
|
1237 | | - try |
1238 | | - { |
1239 | | - byte[] akiExtValue = cert.getExtensionValue(AUTHORITY_KEY_IDENTIFIER); |
1240 | | - if (akiExtValue != null) |
1241 | | - { |
1242 | | - AuthorityKeyIdentifier aki = AuthorityKeyIdentifier.getInstance( |
1243 | | - ASN1OctetString.getInstance(akiExtValue).getOctets()); |
1244 | | - |
1245 | | - ASN1OctetString keyIdentifier = aki.getKeyIdentifierObject(); |
1246 | | - if (keyIdentifier != null) |
1247 | | - { |
1248 | | - selector.setSubjectKeyIdentifier(keyIdentifier.getEncoded(ASN1Encoding.DER)); |
1249 | | - } |
1250 | | - } |
1251 | | - } |
1252 | | - catch (Exception e) |
1253 | | - { |
1254 | | - // authority key identifier could not be retrieved from target cert, just search without it |
1255 | | - } |
| 1235 | + // RFC 3.5.12: explicitly disallows this - subject key identifier may be calculated differently |
| 1236 | +// try |
| 1237 | +// { |
| 1238 | +// byte[] akiExtValue = cert.getExtensionValue(AUTHORITY_KEY_IDENTIFIER); |
| 1239 | +// if (akiExtValue != null) |
| 1240 | +// { |
| 1241 | +// AuthorityKeyIdentifier aki = AuthorityKeyIdentifier.getInstance( |
| 1242 | +// ASN1OctetString.getInstance(akiExtValue).getOctets()); |
| 1243 | +// |
| 1244 | +// ASN1OctetString keyIdentifier = aki.getKeyIdentifierObject(); |
| 1245 | +// if (keyIdentifier != null) |
| 1246 | +// { |
| 1247 | +// selector.setSubjectKeyIdentifier(keyIdentifier.getEncoded(ASN1Encoding.DER)); |
| 1248 | +// } |
| 1249 | +// } |
| 1250 | +// } |
| 1251 | +// catch (Exception e) |
| 1252 | +// { |
| 1253 | +// // authority key identifier could not be retrieved from target cert, just search without it |
| 1254 | +// } |
1256 | 1255 |
|
1257 | 1256 | PKIXCertStoreSelector certSelect = new PKIXCertStoreSelector.Builder(selector).build(); |
1258 | 1257 | Set certs = new LinkedHashSet(); |
|
0 commit comments