mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8239264: Clearup the legacy ObjectIdentifier constructor from int array
Reviewed-by: jnimeh
This commit is contained in:
parent
8aff5bda80
commit
4e430ffbb6
26 changed files with 412 additions and 692 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -42,16 +42,16 @@ public final class AccessDescription {
|
|||
private GeneralName accessLocation;
|
||||
|
||||
public static final ObjectIdentifier Ad_OCSP_Id =
|
||||
ObjectIdentifier.newInternal(new int[] {1, 3, 6, 1, 5, 5, 7, 48, 1});
|
||||
ObjectIdentifier.of("1.3.6.1.5.5.7.48.1");
|
||||
|
||||
public static final ObjectIdentifier Ad_CAISSUERS_Id =
|
||||
ObjectIdentifier.newInternal(new int[] {1, 3, 6, 1, 5, 5, 7, 48, 2});
|
||||
ObjectIdentifier.of("1.3.6.1.5.5.7.48.2");
|
||||
|
||||
public static final ObjectIdentifier Ad_TIMESTAMPING_Id =
|
||||
ObjectIdentifier.newInternal(new int[] {1, 3, 6, 1, 5, 5, 7, 48, 3});
|
||||
ObjectIdentifier.of("1.3.6.1.5.5.7.48.3");
|
||||
|
||||
public static final ObjectIdentifier Ad_CAREPOSITORY_Id =
|
||||
ObjectIdentifier.newInternal(new int[] {1, 3, 6, 1, 5, 5, 7, 48, 5});
|
||||
ObjectIdentifier.of("1.3.6.1.5.5.7.48.5");
|
||||
|
||||
public AccessDescription(ObjectIdentifier accessMethod, GeneralName accessLocation) {
|
||||
this.accessMethod = accessMethod;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -591,10 +591,6 @@ public class AlgorithmId implements Serializable, DerEncoder {
|
|||
return oidTable().get(name.toUpperCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
private static ObjectIdentifier oid(int ... values) {
|
||||
return ObjectIdentifier.newInternal(values);
|
||||
}
|
||||
|
||||
private static volatile Map<String,ObjectIdentifier> oidTable;
|
||||
private static final Map<ObjectIdentifier,String> nameTable;
|
||||
|
||||
|
@ -654,14 +650,14 @@ public class AlgorithmId implements Serializable, DerEncoder {
|
|||
* OID = 1.2.840.113549.2.2
|
||||
*/
|
||||
public static final ObjectIdentifier MD2_oid =
|
||||
ObjectIdentifier.newInternal(new int[] {1, 2, 840, 113549, 2, 2});
|
||||
ObjectIdentifier.of("1.2.840.113549.2.2");
|
||||
|
||||
/**
|
||||
* Algorithm ID for the MD5 Message Digest Algorthm, from RFC 1321.
|
||||
* OID = 1.2.840.113549.2.5
|
||||
*/
|
||||
public static final ObjectIdentifier MD5_oid =
|
||||
ObjectIdentifier.newInternal(new int[] {1, 2, 840, 113549, 2, 5});
|
||||
ObjectIdentifier.of("1.2.840.113549.2.5");
|
||||
|
||||
/**
|
||||
* Algorithm ID for the SHA1 Message Digest Algorithm, from FIPS 180-1.
|
||||
|
@ -670,142 +666,29 @@ public class AlgorithmId implements Serializable, DerEncoder {
|
|||
* OID = 1.3.14.3.2.26. Old SHA-0 OID: 1.3.14.3.2.18.
|
||||
*/
|
||||
public static final ObjectIdentifier SHA_oid =
|
||||
ObjectIdentifier.newInternal(new int[] {1, 3, 14, 3, 2, 26});
|
||||
ObjectIdentifier.of("1.3.14.3.2.26");
|
||||
|
||||
public static final ObjectIdentifier SHA224_oid =
|
||||
ObjectIdentifier.newInternal(new int[] {2, 16, 840, 1, 101, 3, 4, 2, 4});
|
||||
ObjectIdentifier.of("2.16.840.1.101.3.4.2.4");
|
||||
|
||||
public static final ObjectIdentifier SHA256_oid =
|
||||
ObjectIdentifier.newInternal(new int[] {2, 16, 840, 1, 101, 3, 4, 2, 1});
|
||||
ObjectIdentifier.of("2.16.840.1.101.3.4.2.1");
|
||||
|
||||
public static final ObjectIdentifier SHA384_oid =
|
||||
ObjectIdentifier.newInternal(new int[] {2, 16, 840, 1, 101, 3, 4, 2, 2});
|
||||
ObjectIdentifier.of("2.16.840.1.101.3.4.2.2");
|
||||
|
||||
public static final ObjectIdentifier SHA512_oid =
|
||||
ObjectIdentifier.newInternal(new int[] {2, 16, 840, 1, 101, 3, 4, 2, 3});
|
||||
ObjectIdentifier.of("2.16.840.1.101.3.4.2.3");
|
||||
|
||||
public static final ObjectIdentifier SHA512_224_oid =
|
||||
ObjectIdentifier.newInternal(new int[] {2, 16, 840, 1, 101, 3, 4, 2, 5});
|
||||
ObjectIdentifier.of("2.16.840.1.101.3.4.2.5");
|
||||
|
||||
public static final ObjectIdentifier SHA512_256_oid =
|
||||
ObjectIdentifier.newInternal(new int[] {2, 16, 840, 1, 101, 3, 4, 2, 6});
|
||||
ObjectIdentifier.of("2.16.840.1.101.3.4.2.6");
|
||||
|
||||
/*
|
||||
* COMMON PUBLIC KEY TYPES
|
||||
*/
|
||||
private static final int[] DH_data = { 1, 2, 840, 113549, 1, 3, 1 };
|
||||
private static final int[] DH_PKIX_data = { 1, 2, 840, 10046, 2, 1 };
|
||||
private static final int[] DSA_OIW_data = { 1, 3, 14, 3, 2, 12 };
|
||||
private static final int[] DSA_PKIX_data = { 1, 2, 840, 10040, 4, 1 };
|
||||
private static final int[] RSA_data = { 2, 5, 8, 1, 1 };
|
||||
|
||||
public static final ObjectIdentifier DH_oid;
|
||||
public static final ObjectIdentifier DH_PKIX_oid;
|
||||
public static final ObjectIdentifier DSA_oid;
|
||||
public static final ObjectIdentifier DSA_OIW_oid;
|
||||
public static final ObjectIdentifier EC_oid = oid(1, 2, 840, 10045, 2, 1);
|
||||
public static final ObjectIdentifier ECDH_oid = oid(1, 3, 132, 1, 12);
|
||||
public static final ObjectIdentifier RSA_oid;
|
||||
public static final ObjectIdentifier RSAEncryption_oid =
|
||||
oid(1, 2, 840, 113549, 1, 1, 1);
|
||||
public static final ObjectIdentifier RSAES_OAEP_oid =
|
||||
oid(1, 2, 840, 113549, 1, 1, 7);
|
||||
public static final ObjectIdentifier mgf1_oid =
|
||||
oid(1, 2, 840, 113549, 1, 1, 8);
|
||||
public static final ObjectIdentifier RSASSA_PSS_oid =
|
||||
oid(1, 2, 840, 113549, 1, 1, 10);
|
||||
|
||||
/*
|
||||
* COMMON SECRET KEY TYPES
|
||||
*/
|
||||
public static final ObjectIdentifier AES_oid =
|
||||
oid(2, 16, 840, 1, 101, 3, 4, 1);
|
||||
|
||||
/*
|
||||
* COMMON SIGNATURE ALGORITHMS
|
||||
*/
|
||||
private static final int[] md2WithRSAEncryption_data =
|
||||
{ 1, 2, 840, 113549, 1, 1, 2 };
|
||||
private static final int[] md5WithRSAEncryption_data =
|
||||
{ 1, 2, 840, 113549, 1, 1, 4 };
|
||||
private static final int[] sha1WithRSAEncryption_data =
|
||||
{ 1, 2, 840, 113549, 1, 1, 5 };
|
||||
private static final int[] sha1WithRSAEncryption_OIW_data =
|
||||
{ 1, 3, 14, 3, 2, 29 };
|
||||
private static final int[] sha224WithRSAEncryption_data =
|
||||
{ 1, 2, 840, 113549, 1, 1, 14 };
|
||||
private static final int[] sha256WithRSAEncryption_data =
|
||||
{ 1, 2, 840, 113549, 1, 1, 11 };
|
||||
private static final int[] sha384WithRSAEncryption_data =
|
||||
{ 1, 2, 840, 113549, 1, 1, 12 };
|
||||
private static final int[] sha512WithRSAEncryption_data =
|
||||
{ 1, 2, 840, 113549, 1, 1, 13 };
|
||||
|
||||
private static final int[] shaWithDSA_OIW_data =
|
||||
{ 1, 3, 14, 3, 2, 13 };
|
||||
private static final int[] sha1WithDSA_OIW_data =
|
||||
{ 1, 3, 14, 3, 2, 27 };
|
||||
private static final int[] dsaWithSHA1_PKIX_data =
|
||||
{ 1, 2, 840, 10040, 4, 3 };
|
||||
|
||||
public static final ObjectIdentifier md2WithRSAEncryption_oid;
|
||||
public static final ObjectIdentifier md5WithRSAEncryption_oid;
|
||||
public static final ObjectIdentifier sha1WithRSAEncryption_oid;
|
||||
public static final ObjectIdentifier sha1WithRSAEncryption_OIW_oid;
|
||||
public static final ObjectIdentifier sha224WithRSAEncryption_oid;
|
||||
public static final ObjectIdentifier sha256WithRSAEncryption_oid;
|
||||
public static final ObjectIdentifier sha384WithRSAEncryption_oid;
|
||||
public static final ObjectIdentifier sha512WithRSAEncryption_oid;
|
||||
public static final ObjectIdentifier sha512_224WithRSAEncryption_oid =
|
||||
oid(1, 2, 840, 113549, 1, 1, 15);
|
||||
public static final ObjectIdentifier sha512_256WithRSAEncryption_oid =
|
||||
oid(1, 2, 840, 113549, 1, 1, 16);;
|
||||
|
||||
public static final ObjectIdentifier shaWithDSA_OIW_oid;
|
||||
public static final ObjectIdentifier sha1WithDSA_OIW_oid;
|
||||
public static final ObjectIdentifier sha1WithDSA_oid;
|
||||
public static final ObjectIdentifier sha224WithDSA_oid =
|
||||
oid(2, 16, 840, 1, 101, 3, 4, 3, 1);
|
||||
public static final ObjectIdentifier sha256WithDSA_oid =
|
||||
oid(2, 16, 840, 1, 101, 3, 4, 3, 2);
|
||||
|
||||
public static final ObjectIdentifier sha1WithECDSA_oid =
|
||||
oid(1, 2, 840, 10045, 4, 1);
|
||||
public static final ObjectIdentifier sha224WithECDSA_oid =
|
||||
oid(1, 2, 840, 10045, 4, 3, 1);
|
||||
public static final ObjectIdentifier sha256WithECDSA_oid =
|
||||
oid(1, 2, 840, 10045, 4, 3, 2);
|
||||
public static final ObjectIdentifier sha384WithECDSA_oid =
|
||||
oid(1, 2, 840, 10045, 4, 3, 3);
|
||||
public static final ObjectIdentifier sha512WithECDSA_oid =
|
||||
oid(1, 2, 840, 10045, 4, 3, 4);
|
||||
public static final ObjectIdentifier specifiedWithECDSA_oid =
|
||||
oid(1, 2, 840, 10045, 4, 3);
|
||||
|
||||
/**
|
||||
* Algorithm ID for the PBE encryption algorithms from PKCS#5 and
|
||||
* PKCS#12.
|
||||
*/
|
||||
public static final ObjectIdentifier pbeWithMD5AndDES_oid =
|
||||
ObjectIdentifier.newInternal(new int[]{1, 2, 840, 113549, 1, 5, 3});
|
||||
public static final ObjectIdentifier pbeWithMD5AndRC2_oid =
|
||||
ObjectIdentifier.newInternal(new int[] {1, 2, 840, 113549, 1, 5, 6});
|
||||
public static final ObjectIdentifier pbeWithSHA1AndDES_oid =
|
||||
ObjectIdentifier.newInternal(new int[] {1, 2, 840, 113549, 1, 5, 10});
|
||||
public static final ObjectIdentifier pbeWithSHA1AndRC2_oid =
|
||||
ObjectIdentifier.newInternal(new int[] {1, 2, 840, 113549, 1, 5, 11});
|
||||
public static ObjectIdentifier pbeWithSHA1AndRC4_128_oid =
|
||||
ObjectIdentifier.newInternal(new int[] {1, 2, 840, 113549, 1, 12, 1, 1});
|
||||
public static ObjectIdentifier pbeWithSHA1AndRC4_40_oid =
|
||||
ObjectIdentifier.newInternal(new int[] {1, 2, 840, 113549, 1, 12, 1, 2});
|
||||
public static ObjectIdentifier pbeWithSHA1AndDESede_oid =
|
||||
ObjectIdentifier.newInternal(new int[] {1, 2, 840, 113549, 1, 12, 1, 3});
|
||||
public static ObjectIdentifier pbeWithSHA1AndRC2_128_oid =
|
||||
ObjectIdentifier.newInternal(new int[] {1, 2, 840, 113549, 1, 12, 1, 5});
|
||||
public static ObjectIdentifier pbeWithSHA1AndRC2_40_oid =
|
||||
ObjectIdentifier.newInternal(new int[] {1, 2, 840, 113549, 1, 12, 1, 6});
|
||||
|
||||
static {
|
||||
/*
|
||||
* Note the preferred OIDs are named simply with no "OIW" or
|
||||
* "PKIX" in them, even though they may point to data from these
|
||||
|
@ -819,14 +702,16 @@ public class AlgorithmId implements Serializable, DerEncoder {
|
|||
* certificate.
|
||||
* OID = 1.2.840.113549.1.3.1
|
||||
*/
|
||||
DH_oid = ObjectIdentifier.newInternal(DH_data);
|
||||
public static final ObjectIdentifier DH_oid =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.3.1");
|
||||
|
||||
/**
|
||||
* Algorithm ID for the Diffie Hellman Key Agreement (DH), from RFC 3279.
|
||||
* Parameters may include public values P and G.
|
||||
* OID = 1.2.840.10046.2.1
|
||||
*/
|
||||
DH_PKIX_oid = ObjectIdentifier.newInternal(DH_PKIX_data);
|
||||
public static final ObjectIdentifier DH_PKIX_oid =
|
||||
ObjectIdentifier.of("1.2.840.10046.2.1");
|
||||
|
||||
/**
|
||||
* Algorithm ID for the Digital Signing Algorithm (DSA), from the
|
||||
|
@ -836,7 +721,8 @@ public class AlgorithmId implements Serializable, DerEncoder {
|
|||
* another source such as a Certificate Authority's certificate.
|
||||
* OID = 1.3.14.3.2.12
|
||||
*/
|
||||
DSA_OIW_oid = ObjectIdentifier.newInternal(DSA_OIW_data);
|
||||
public static final ObjectIdentifier DSA_OIW_oid =
|
||||
ObjectIdentifier.of("1.3.14.3.2.12");
|
||||
|
||||
/**
|
||||
* Algorithm ID for the Digital Signing Algorithm (DSA), from RFC 3279.
|
||||
|
@ -845,7 +731,8 @@ public class AlgorithmId implements Serializable, DerEncoder {
|
|||
* certificate.
|
||||
* OID = 1.2.840.10040.4.1
|
||||
*/
|
||||
DSA_oid = ObjectIdentifier.newInternal(DSA_PKIX_data);
|
||||
public static final ObjectIdentifier DSA_oid =
|
||||
ObjectIdentifier.of("1.2.840.10040.4.1");
|
||||
|
||||
/**
|
||||
* Algorithm ID for RSA keys used for any purpose, as defined in X.509.
|
||||
|
@ -853,72 +740,95 @@ public class AlgorithmId implements Serializable, DerEncoder {
|
|||
* public modulus.
|
||||
* OID = 2.5.8.1.1
|
||||
*/
|
||||
RSA_oid = ObjectIdentifier.newInternal(RSA_data);
|
||||
public static final ObjectIdentifier RSA_oid =
|
||||
ObjectIdentifier.of("2.5.8.1.1");
|
||||
|
||||
public static final ObjectIdentifier EC_oid =
|
||||
ObjectIdentifier.of("1.2.840.10045.2.1");
|
||||
public static final ObjectIdentifier ECDH_oid =
|
||||
ObjectIdentifier.of("1.3.132.1.12");
|
||||
public static final ObjectIdentifier RSAEncryption_oid =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.1.1");
|
||||
public static final ObjectIdentifier RSAES_OAEP_oid =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.1.7");
|
||||
public static final ObjectIdentifier mgf1_oid =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.1.8");
|
||||
public static final ObjectIdentifier RSASSA_PSS_oid =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.1.10");
|
||||
|
||||
/*
|
||||
* COMMON SECRET KEY TYPES
|
||||
*/
|
||||
public static final ObjectIdentifier AES_oid =
|
||||
ObjectIdentifier.of("2.16.840.1.101.3.4.1");
|
||||
|
||||
/*
|
||||
* COMMON SIGNATURE ALGORITHMS
|
||||
*/
|
||||
/**
|
||||
* Identifies a signing algorithm where an MD2 digest is encrypted
|
||||
* using an RSA private key; defined in PKCS #1. Use of this
|
||||
* signing algorithm is discouraged due to MD2 vulnerabilities.
|
||||
* OID = 1.2.840.113549.1.1.2
|
||||
*/
|
||||
md2WithRSAEncryption_oid =
|
||||
ObjectIdentifier.newInternal(md2WithRSAEncryption_data);
|
||||
public static final ObjectIdentifier md2WithRSAEncryption_oid =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.1.2");
|
||||
|
||||
/**
|
||||
* Identifies a signing algorithm where an MD5 digest is
|
||||
* encrypted using an RSA private key; defined in PKCS #1.
|
||||
* OID = 1.2.840.113549.1.1.4
|
||||
*/
|
||||
md5WithRSAEncryption_oid =
|
||||
ObjectIdentifier.newInternal(md5WithRSAEncryption_data);
|
||||
public static final ObjectIdentifier md5WithRSAEncryption_oid =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.1.4");
|
||||
|
||||
/**
|
||||
* Identifies a signing algorithm where a SHA1 digest is
|
||||
* encrypted using an RSA private key; defined by RSA DSI.
|
||||
* OID = 1.2.840.113549.1.1.5
|
||||
*/
|
||||
sha1WithRSAEncryption_oid =
|
||||
ObjectIdentifier.newInternal(sha1WithRSAEncryption_data);
|
||||
public static final ObjectIdentifier sha1WithRSAEncryption_oid =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.1.5");
|
||||
|
||||
/**
|
||||
* Identifies a signing algorithm where a SHA1 digest is
|
||||
* encrypted using an RSA private key; defined in NIST OIW.
|
||||
* OID = 1.3.14.3.2.29
|
||||
*/
|
||||
sha1WithRSAEncryption_OIW_oid =
|
||||
ObjectIdentifier.newInternal(sha1WithRSAEncryption_OIW_data);
|
||||
public static final ObjectIdentifier sha1WithRSAEncryption_OIW_oid =
|
||||
ObjectIdentifier.of("1.3.14.3.2.29");
|
||||
|
||||
/**
|
||||
* Identifies a signing algorithm where a SHA224 digest is
|
||||
* encrypted using an RSA private key; defined by PKCS #1.
|
||||
* OID = 1.2.840.113549.1.1.14
|
||||
*/
|
||||
sha224WithRSAEncryption_oid =
|
||||
ObjectIdentifier.newInternal(sha224WithRSAEncryption_data);
|
||||
public static final ObjectIdentifier sha224WithRSAEncryption_oid =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.1.14");
|
||||
|
||||
/**
|
||||
* Identifies a signing algorithm where a SHA256 digest is
|
||||
* encrypted using an RSA private key; defined by PKCS #1.
|
||||
* OID = 1.2.840.113549.1.1.11
|
||||
*/
|
||||
sha256WithRSAEncryption_oid =
|
||||
ObjectIdentifier.newInternal(sha256WithRSAEncryption_data);
|
||||
public static final ObjectIdentifier sha256WithRSAEncryption_oid =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.1.11");
|
||||
|
||||
/**
|
||||
* Identifies a signing algorithm where a SHA384 digest is
|
||||
* encrypted using an RSA private key; defined by PKCS #1.
|
||||
* OID = 1.2.840.113549.1.1.12
|
||||
*/
|
||||
sha384WithRSAEncryption_oid =
|
||||
ObjectIdentifier.newInternal(sha384WithRSAEncryption_data);
|
||||
public static final ObjectIdentifier sha384WithRSAEncryption_oid =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.1.12");
|
||||
|
||||
/**
|
||||
* Identifies a signing algorithm where a SHA512 digest is
|
||||
* encrypted using an RSA private key; defined by PKCS #1.
|
||||
* OID = 1.2.840.113549.1.1.13
|
||||
*/
|
||||
sha512WithRSAEncryption_oid =
|
||||
ObjectIdentifier.newInternal(sha512WithRSAEncryption_data);
|
||||
public static final ObjectIdentifier sha512WithRSAEncryption_oid =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.1.13");
|
||||
|
||||
/**
|
||||
* Identifies the FIPS 186 "Digital Signature Standard" (DSS), where a
|
||||
|
@ -926,22 +836,72 @@ public class AlgorithmId implements Serializable, DerEncoder {
|
|||
* This should not be used.
|
||||
* OID = 1.3.14.3.2.13
|
||||
*/
|
||||
shaWithDSA_OIW_oid = ObjectIdentifier.newInternal(shaWithDSA_OIW_data);
|
||||
public static final ObjectIdentifier shaWithDSA_OIW_oid =
|
||||
ObjectIdentifier.of("1.3.14.3.2.13");
|
||||
|
||||
/**
|
||||
* Identifies the FIPS 186 "Digital Signature Standard" (DSS), where a
|
||||
* SHA1 digest is signed using the Digital Signing Algorithm (DSA).
|
||||
* OID = 1.3.14.3.2.27
|
||||
*/
|
||||
sha1WithDSA_OIW_oid = ObjectIdentifier.newInternal(sha1WithDSA_OIW_data);
|
||||
public static final ObjectIdentifier sha1WithDSA_OIW_oid =
|
||||
ObjectIdentifier.of("1.3.14.3.2.27");
|
||||
|
||||
/**
|
||||
* Identifies the FIPS 186 "Digital Signature Standard" (DSS), where a
|
||||
* SHA1 digest is signed using the Digital Signing Algorithm (DSA).
|
||||
* OID = 1.2.840.10040.4.3
|
||||
*/
|
||||
sha1WithDSA_oid = ObjectIdentifier.newInternal(dsaWithSHA1_PKIX_data);
|
||||
public static final ObjectIdentifier sha1WithDSA_oid =
|
||||
ObjectIdentifier.of("1.2.840.10040.4.3");
|
||||
|
||||
public static final ObjectIdentifier sha512_224WithRSAEncryption_oid =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.1.15");
|
||||
public static final ObjectIdentifier sha512_256WithRSAEncryption_oid =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.1.16");
|
||||
|
||||
public static final ObjectIdentifier sha224WithDSA_oid =
|
||||
ObjectIdentifier.of("2.16.840.1.101.3.4.3.1");
|
||||
public static final ObjectIdentifier sha256WithDSA_oid =
|
||||
ObjectIdentifier.of("2.16.840.1.101.3.4.3.2");
|
||||
|
||||
public static final ObjectIdentifier sha1WithECDSA_oid =
|
||||
ObjectIdentifier.of("1.2.840.10045.4.1");
|
||||
public static final ObjectIdentifier sha224WithECDSA_oid =
|
||||
ObjectIdentifier.of("1.2.840.10045.4.3.1");
|
||||
public static final ObjectIdentifier sha256WithECDSA_oid =
|
||||
ObjectIdentifier.of("1.2.840.10045.4.3.2");
|
||||
public static final ObjectIdentifier sha384WithECDSA_oid =
|
||||
ObjectIdentifier.of("1.2.840.10045.4.3.3");
|
||||
public static final ObjectIdentifier sha512WithECDSA_oid =
|
||||
ObjectIdentifier.of("1.2.840.10045.4.3.4");
|
||||
public static final ObjectIdentifier specifiedWithECDSA_oid =
|
||||
ObjectIdentifier.of("1.2.840.10045.4.3");
|
||||
|
||||
/**
|
||||
* Algorithm ID for the PBE encryption algorithms from PKCS#5 and
|
||||
* PKCS#12.
|
||||
*/
|
||||
public static final ObjectIdentifier pbeWithMD5AndDES_oid =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.5.3");
|
||||
public static final ObjectIdentifier pbeWithMD5AndRC2_oid =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.5.6");
|
||||
public static final ObjectIdentifier pbeWithSHA1AndDES_oid =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.5.10");
|
||||
public static final ObjectIdentifier pbeWithSHA1AndRC2_oid =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.5.11");
|
||||
public static final ObjectIdentifier pbeWithSHA1AndRC4_128_oid =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.12.1.1");
|
||||
public static final ObjectIdentifier pbeWithSHA1AndRC4_40_oid =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.12.1.2");
|
||||
public static final ObjectIdentifier pbeWithSHA1AndDESede_oid =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.12.1.3");
|
||||
public static final ObjectIdentifier pbeWithSHA1AndRC2_128_oid =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.12.1.5");
|
||||
public static final ObjectIdentifier pbeWithSHA1AndRC2_40_oid =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.12.1.6");
|
||||
|
||||
static {
|
||||
nameTable = new HashMap<>();
|
||||
nameTable.put(MD5_oid, "MD5");
|
||||
nameTable.put(MD2_oid, "MD2");
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -97,30 +97,19 @@ implements CertAttrSet<String> {
|
|||
// OID defined in RFC 5280 Sections 4.2.1.12
|
||||
// more from http://www.alvestrand.no/objectid/1.3.6.1.5.5.7.3.html
|
||||
private static final Map <ObjectIdentifier, String> map =
|
||||
new HashMap <ObjectIdentifier, String> ();
|
||||
|
||||
private static final int[] anyExtendedKeyUsageOidData = {2, 5, 29, 37, 0};
|
||||
private static final int[] serverAuthOidData = {1, 3, 6, 1, 5, 5, 7, 3, 1};
|
||||
private static final int[] clientAuthOidData = {1, 3, 6, 1, 5, 5, 7, 3, 2};
|
||||
private static final int[] codeSigningOidData = {1, 3, 6, 1, 5, 5, 7, 3, 3};
|
||||
private static final int[] emailProtectionOidData = {1, 3, 6, 1, 5, 5, 7, 3, 4};
|
||||
private static final int[] ipsecEndSystemOidData = {1, 3, 6, 1, 5, 5, 7, 3, 5};
|
||||
private static final int[] ipsecTunnelOidData = {1, 3, 6, 1, 5, 5, 7, 3, 6};
|
||||
private static final int[] ipsecUserOidData = {1, 3, 6, 1, 5, 5, 7, 3, 7};
|
||||
private static final int[] timeStampingOidData = {1, 3, 6, 1, 5, 5, 7, 3, 8};
|
||||
private static final int[] OCSPSigningOidData = {1, 3, 6, 1, 5, 5, 7, 3, 9};
|
||||
new HashMap<ObjectIdentifier, String>();
|
||||
|
||||
static {
|
||||
map.put(ObjectIdentifier.newInternal(anyExtendedKeyUsageOidData), "anyExtendedKeyUsage");
|
||||
map.put(ObjectIdentifier.newInternal(serverAuthOidData), "serverAuth");
|
||||
map.put(ObjectIdentifier.newInternal(clientAuthOidData), "clientAuth");
|
||||
map.put(ObjectIdentifier.newInternal(codeSigningOidData), "codeSigning");
|
||||
map.put(ObjectIdentifier.newInternal(emailProtectionOidData), "emailProtection");
|
||||
map.put(ObjectIdentifier.newInternal(ipsecEndSystemOidData), "ipsecEndSystem");
|
||||
map.put(ObjectIdentifier.newInternal(ipsecTunnelOidData), "ipsecTunnel");
|
||||
map.put(ObjectIdentifier.newInternal(ipsecUserOidData), "ipsecUser");
|
||||
map.put(ObjectIdentifier.newInternal(timeStampingOidData), "timeStamping");
|
||||
map.put(ObjectIdentifier.newInternal(OCSPSigningOidData), "OCSPSigning");
|
||||
map.put(ObjectIdentifier.of("2.5.29.37.0"), "anyExtendedKeyUsage");
|
||||
map.put(ObjectIdentifier.of("1.3.6.1.5.5.7.3.1"), "serverAuth");
|
||||
map.put(ObjectIdentifier.of("1.3.6.1.5.5.7.3.2"), "clientAuth");
|
||||
map.put(ObjectIdentifier.of("1.3.6.1.5.5.7.3.3"), "codeSigning");
|
||||
map.put(ObjectIdentifier.of("1.3.6.1.5.5.7.3.4"), "emailProtection");
|
||||
map.put(ObjectIdentifier.of("1.3.6.1.5.5.7.3.5"), "ipsecEndSystem");
|
||||
map.put(ObjectIdentifier.of("1.3.6.1.5.5.7.3.6"), "ipsecTunnel");
|
||||
map.put(ObjectIdentifier.of("1.3.6.1.5.5.7.3.7"), "ipsecUser");
|
||||
map.put(ObjectIdentifier.of("1.3.6.1.5.5.7.3.8"), "timeStamping");
|
||||
map.put(ObjectIdentifier.of("1.3.6.1.5.5.7.3.9"), "OCSPSigning");
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -270,8 +270,7 @@ public class GeneralSubtrees implements Cloneable {
|
|||
newName = new GeneralName(new IPAddressName((byte[])null));
|
||||
break;
|
||||
case GeneralNameInterface.NAME_OID:
|
||||
newName = new GeneralName
|
||||
(new OIDName(new ObjectIdentifier((int[])null)));
|
||||
newName = new GeneralName(new OIDName(""));
|
||||
break;
|
||||
default:
|
||||
throw new IOException
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -75,14 +75,8 @@ implements CertAttrSet<String> {
|
|||
/**
|
||||
* Object identifier for "any-policy"
|
||||
*/
|
||||
public static ObjectIdentifier AnyPolicy_Id;
|
||||
static {
|
||||
try {
|
||||
AnyPolicy_Id = new ObjectIdentifier("2.5.29.32.0");
|
||||
} catch (IOException ioe) {
|
||||
// Should not happen
|
||||
}
|
||||
}
|
||||
public static ObjectIdentifier AnyPolicy_Id =
|
||||
ObjectIdentifier.of("2.5.29.32.0");
|
||||
|
||||
/**
|
||||
* Attribute names.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -69,20 +69,11 @@ implements CertAttrSet<String> {
|
|||
public static final String S_MIME_CA = "s_mime_ca";
|
||||
public static final String OBJECT_SIGNING_CA = "object_signing_ca";
|
||||
|
||||
private static final int[] CertType_data = { 2, 16, 840, 1, 113730, 1, 1 };
|
||||
|
||||
/**
|
||||
* Object identifier for the Netscape-Cert-Type extension.
|
||||
*/
|
||||
public static ObjectIdentifier NetscapeCertType_Id;
|
||||
|
||||
static {
|
||||
try {
|
||||
NetscapeCertType_Id = new ObjectIdentifier(CertType_data);
|
||||
} catch (IOException ioe) {
|
||||
// should not happen
|
||||
}
|
||||
}
|
||||
public static ObjectIdentifier NetscapeCertType_Id =
|
||||
ObjectIdentifier.of("2.16.840.1.113730.1.1");
|
||||
|
||||
private boolean[] bitString;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -102,9 +102,6 @@ public class OIDMap {
|
|||
private static final String OCSPNOCHECK = ROOT + "." +
|
||||
OCSPNoCheckExtension.NAME;
|
||||
|
||||
private static final int[] NetscapeCertType_data =
|
||||
{ 2, 16, 840, 1, 113730, 1, 1 };
|
||||
|
||||
/** Map ObjectIdentifier(oid) -> OIDInfo(info) */
|
||||
private static final Map<ObjectIdentifier,OIDInfo> oidMap;
|
||||
|
||||
|
@ -138,8 +135,8 @@ public class OIDMap {
|
|||
"sun.security.x509.AuthorityKeyIdentifierExtension");
|
||||
addInternal(POLICY_CONSTRAINTS, PKIXExtensions.PolicyConstraints_Id,
|
||||
"sun.security.x509.PolicyConstraintsExtension");
|
||||
addInternal(NETSCAPE_CERT, ObjectIdentifier.newInternal
|
||||
(new int[] {2,16,840,1,113730,1,1}),
|
||||
addInternal(NETSCAPE_CERT,
|
||||
ObjectIdentifier.of("2.16.840.1.113730.1.1"),
|
||||
"sun.security.x509.NetscapeCertTypeExtension");
|
||||
addInternal(CERT_POLICIES, PKIXExtensions.CertificatePolicies_Id,
|
||||
"sun.security.x509.CertificatePoliciesExtension");
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -25,7 +25,6 @@
|
|||
|
||||
package sun.security.x509;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
import sun.security.util.*;
|
||||
|
||||
|
@ -48,163 +47,151 @@ import sun.security.util.*;
|
|||
* @author Hemma Prafullchandra
|
||||
*/
|
||||
public class PKIXExtensions {
|
||||
// The object identifiers
|
||||
private static final int[] AuthorityKey_data = { 2, 5, 29, 35 };
|
||||
private static final int[] SubjectKey_data = { 2, 5, 29, 14 };
|
||||
private static final int[] KeyUsage_data = { 2, 5, 29, 15 };
|
||||
private static final int[] PrivateKeyUsage_data = { 2, 5, 29, 16 };
|
||||
private static final int[] CertificatePolicies_data = { 2, 5, 29, 32 };
|
||||
private static final int[] PolicyMappings_data = { 2, 5, 29, 33 };
|
||||
private static final int[] SubjectAlternativeName_data = { 2, 5, 29, 17 };
|
||||
private static final int[] IssuerAlternativeName_data = { 2, 5, 29, 18 };
|
||||
private static final int[] SubjectDirectoryAttributes_data = { 2, 5, 29, 9 };
|
||||
private static final int[] BasicConstraints_data = { 2, 5, 29, 19 };
|
||||
private static final int[] NameConstraints_data = { 2, 5, 29, 30 };
|
||||
private static final int[] PolicyConstraints_data = { 2, 5, 29, 36 };
|
||||
private static final int[] CRLDistributionPoints_data = { 2, 5, 29, 31 };
|
||||
private static final int[] CRLNumber_data = { 2, 5, 29, 20 };
|
||||
private static final int[] IssuingDistributionPoint_data = { 2, 5, 29, 28 };
|
||||
private static final int[] DeltaCRLIndicator_data = { 2, 5, 29, 27 };
|
||||
private static final int[] ReasonCode_data = { 2, 5, 29, 21 };
|
||||
private static final int[] HoldInstructionCode_data = { 2, 5, 29, 23 };
|
||||
private static final int[] InvalidityDate_data = { 2, 5, 29, 24 };
|
||||
private static final int[] ExtendedKeyUsage_data = { 2, 5, 29, 37 };
|
||||
private static final int[] InhibitAnyPolicy_data = { 2, 5, 29, 54 };
|
||||
private static final int[] CertificateIssuer_data = { 2, 5, 29, 29 };
|
||||
private static final int[] AuthInfoAccess_data = { 1, 3, 6, 1, 5, 5, 7, 1, 1};
|
||||
private static final int[] SubjectInfoAccess_data = { 1, 3, 6, 1, 5, 5, 7, 1, 11};
|
||||
private static final int[] FreshestCRL_data = { 2, 5, 29, 46 };
|
||||
private static final int[] OCSPNoCheck_data = { 1, 3, 6, 1, 5, 5, 7,
|
||||
48, 1, 5};
|
||||
|
||||
// Additional extensions under the PKIX arc that are not necessarily
|
||||
// used in X.509 Certificates or CRLs.
|
||||
private static final int OCSPNonce_data [] = { 1, 3, 6, 1, 5, 5, 7,
|
||||
48, 1, 2};
|
||||
|
||||
/**
|
||||
* Identifies the particular public key used to sign the certificate.
|
||||
*/
|
||||
public static final ObjectIdentifier AuthorityKey_Id;
|
||||
public static final ObjectIdentifier AuthorityKey_Id =
|
||||
ObjectIdentifier.of("2.5.29.35");
|
||||
|
||||
/**
|
||||
* Identifies the particular public key used in an application.
|
||||
*/
|
||||
public static final ObjectIdentifier SubjectKey_Id;
|
||||
public static final ObjectIdentifier SubjectKey_Id =
|
||||
ObjectIdentifier.of("2.5.29.14");
|
||||
|
||||
/**
|
||||
* Defines the purpose of the key contained in the certificate.
|
||||
*/
|
||||
public static final ObjectIdentifier KeyUsage_Id;
|
||||
public static final ObjectIdentifier KeyUsage_Id =
|
||||
ObjectIdentifier.of("2.5.29.15");
|
||||
|
||||
/**
|
||||
* Allows the certificate issuer to specify a different validity period
|
||||
* for the private key than the certificate.
|
||||
*/
|
||||
public static final ObjectIdentifier PrivateKeyUsage_Id;
|
||||
public static final ObjectIdentifier PrivateKeyUsage_Id =
|
||||
ObjectIdentifier.of("2.5.29.16");
|
||||
|
||||
/**
|
||||
* Contains the sequence of policy information terms.
|
||||
*/
|
||||
public static final ObjectIdentifier CertificatePolicies_Id;
|
||||
public static final ObjectIdentifier CertificatePolicies_Id =
|
||||
ObjectIdentifier.of("2.5.29.32");
|
||||
|
||||
/**
|
||||
* Lists pairs of object identifiers of policies considered equivalent by
|
||||
* the issuing CA to the subject CA.
|
||||
*/
|
||||
public static final ObjectIdentifier PolicyMappings_Id;
|
||||
public static final ObjectIdentifier PolicyMappings_Id =
|
||||
ObjectIdentifier.of("2.5.29.33");
|
||||
|
||||
/**
|
||||
* Allows additional identities to be bound to the subject of the
|
||||
* certificate.
|
||||
*/
|
||||
public static final ObjectIdentifier SubjectAlternativeName_Id;
|
||||
public static final ObjectIdentifier SubjectAlternativeName_Id =
|
||||
ObjectIdentifier.of("2.5.29.17");
|
||||
|
||||
/**
|
||||
* Allows additional identities to be associated with the certificate
|
||||
* issuer.
|
||||
*/
|
||||
public static final ObjectIdentifier IssuerAlternativeName_Id;
|
||||
public static final ObjectIdentifier IssuerAlternativeName_Id =
|
||||
ObjectIdentifier.of("2.5.29.18");
|
||||
|
||||
/**
|
||||
* Identifies additional directory attributes.
|
||||
* This extension is always non-critical.
|
||||
*/
|
||||
public static final ObjectIdentifier SubjectDirectoryAttributes_Id;
|
||||
public static final ObjectIdentifier SubjectDirectoryAttributes_Id =
|
||||
ObjectIdentifier.of("2.5.29.9");
|
||||
|
||||
/**
|
||||
* Identifies whether the subject of the certificate is a CA and how deep
|
||||
* a certification path may exist through that CA.
|
||||
*/
|
||||
public static final ObjectIdentifier BasicConstraints_Id;
|
||||
public static final ObjectIdentifier BasicConstraints_Id =
|
||||
ObjectIdentifier.of("2.5.29.19");
|
||||
|
||||
/**
|
||||
* Provides for permitted and excluded subtrees that place restrictions
|
||||
* on names that may be included within a certificate issued by a given CA.
|
||||
*/
|
||||
public static final ObjectIdentifier NameConstraints_Id;
|
||||
public static final ObjectIdentifier NameConstraints_Id =
|
||||
ObjectIdentifier.of("2.5.29.30");
|
||||
|
||||
/**
|
||||
* Used to either prohibit policy mapping or limit the set of policies
|
||||
* that can be in subsequent certificates.
|
||||
*/
|
||||
public static final ObjectIdentifier PolicyConstraints_Id;
|
||||
public static final ObjectIdentifier PolicyConstraints_Id =
|
||||
ObjectIdentifier.of("2.5.29.36");
|
||||
|
||||
/**
|
||||
* Identifies how CRL information is obtained.
|
||||
*/
|
||||
public static final ObjectIdentifier CRLDistributionPoints_Id;
|
||||
public static final ObjectIdentifier CRLDistributionPoints_Id =
|
||||
ObjectIdentifier.of("2.5.29.31");
|
||||
|
||||
/**
|
||||
* Conveys a monotonically increasing sequence number for each CRL
|
||||
* issued by a given CA.
|
||||
*/
|
||||
public static final ObjectIdentifier CRLNumber_Id;
|
||||
public static final ObjectIdentifier CRLNumber_Id =
|
||||
ObjectIdentifier.of("2.5.29.20");
|
||||
|
||||
/**
|
||||
* Identifies the CRL distribution point for a particular CRL.
|
||||
*/
|
||||
public static final ObjectIdentifier IssuingDistributionPoint_Id;
|
||||
public static final ObjectIdentifier IssuingDistributionPoint_Id =
|
||||
ObjectIdentifier.of("2.5.29.28");
|
||||
|
||||
/**
|
||||
* Identifies the delta CRL.
|
||||
*/
|
||||
public static final ObjectIdentifier DeltaCRLIndicator_Id;
|
||||
public static final ObjectIdentifier DeltaCRLIndicator_Id =
|
||||
ObjectIdentifier.of("2.5.29.27");
|
||||
|
||||
/**
|
||||
* Identifies the reason for the certificate revocation.
|
||||
*/
|
||||
public static final ObjectIdentifier ReasonCode_Id;
|
||||
public static final ObjectIdentifier ReasonCode_Id =
|
||||
ObjectIdentifier.of("2.5.29.21");
|
||||
|
||||
/**
|
||||
* This extension provides a registered instruction identifier indicating
|
||||
* the action to be taken, after encountering a certificate that has been
|
||||
* placed on hold.
|
||||
*/
|
||||
public static final ObjectIdentifier HoldInstructionCode_Id;
|
||||
public static final ObjectIdentifier HoldInstructionCode_Id =
|
||||
ObjectIdentifier.of("2.5.29.23");
|
||||
|
||||
/**
|
||||
* Identifies the date on which it is known or suspected that the private
|
||||
* key was compromised or that the certificate otherwise became invalid.
|
||||
*/
|
||||
public static final ObjectIdentifier InvalidityDate_Id;
|
||||
public static final ObjectIdentifier InvalidityDate_Id =
|
||||
ObjectIdentifier.of("2.5.29.24");
|
||||
/**
|
||||
* Identifies one or more purposes for which the certified public key
|
||||
* may be used, in addition to or in place of the basic purposes
|
||||
* indicated in the key usage extension field.
|
||||
*/
|
||||
public static final ObjectIdentifier ExtendedKeyUsage_Id;
|
||||
public static final ObjectIdentifier ExtendedKeyUsage_Id =
|
||||
ObjectIdentifier.of("2.5.29.37");
|
||||
|
||||
/**
|
||||
* Specifies whether any-policy policy OID is permitted
|
||||
*/
|
||||
public static final ObjectIdentifier InhibitAnyPolicy_Id;
|
||||
public static final ObjectIdentifier InhibitAnyPolicy_Id =
|
||||
ObjectIdentifier.of("2.5.29.54");
|
||||
|
||||
/**
|
||||
* Identifies the certificate issuer associated with an entry in an
|
||||
* indirect CRL.
|
||||
*/
|
||||
public static final ObjectIdentifier CertificateIssuer_Id;
|
||||
public static final ObjectIdentifier CertificateIssuer_Id =
|
||||
ObjectIdentifier.of("2.5.29.29");
|
||||
|
||||
/**
|
||||
* This extension indicates how to access CA information and services for
|
||||
|
@ -212,73 +199,33 @@ public class PKIXExtensions {
|
|||
* This information may be used for on-line certification validation
|
||||
* services.
|
||||
*/
|
||||
public static final ObjectIdentifier AuthInfoAccess_Id;
|
||||
public static final ObjectIdentifier AuthInfoAccess_Id =
|
||||
ObjectIdentifier.of("1.3.6.1.5.5.7.1.1");
|
||||
|
||||
/**
|
||||
* This extension indicates how to access CA information and services for
|
||||
* the subject of the certificate in which the extension appears.
|
||||
*/
|
||||
public static final ObjectIdentifier SubjectInfoAccess_Id;
|
||||
public static final ObjectIdentifier SubjectInfoAccess_Id =
|
||||
ObjectIdentifier.of("1.3.6.1.5.5.7.1.11");
|
||||
|
||||
/**
|
||||
* Identifies how delta CRL information is obtained.
|
||||
*/
|
||||
public static final ObjectIdentifier FreshestCRL_Id;
|
||||
public static final ObjectIdentifier FreshestCRL_Id =
|
||||
ObjectIdentifier.of("2.5.29.46");
|
||||
|
||||
/**
|
||||
* Identifies the OCSP client can trust the responder for the
|
||||
* lifetime of the responder's certificate.
|
||||
*/
|
||||
public static final ObjectIdentifier OCSPNoCheck_Id;
|
||||
public static final ObjectIdentifier OCSPNoCheck_Id =
|
||||
ObjectIdentifier.of("1.3.6.1.5.5.7.48.1.5");
|
||||
|
||||
/**
|
||||
* This extension is used to provide nonce data for OCSP requests
|
||||
* or responses.
|
||||
*/
|
||||
public static final ObjectIdentifier OCSPNonce_Id;
|
||||
|
||||
static {
|
||||
AuthorityKey_Id = ObjectIdentifier.newInternal(AuthorityKey_data);
|
||||
SubjectKey_Id = ObjectIdentifier.newInternal(SubjectKey_data);
|
||||
KeyUsage_Id = ObjectIdentifier.newInternal(KeyUsage_data);
|
||||
PrivateKeyUsage_Id = ObjectIdentifier.newInternal(PrivateKeyUsage_data);
|
||||
CertificatePolicies_Id =
|
||||
ObjectIdentifier.newInternal(CertificatePolicies_data);
|
||||
PolicyMappings_Id = ObjectIdentifier.newInternal(PolicyMappings_data);
|
||||
SubjectAlternativeName_Id =
|
||||
ObjectIdentifier.newInternal(SubjectAlternativeName_data);
|
||||
IssuerAlternativeName_Id =
|
||||
ObjectIdentifier.newInternal(IssuerAlternativeName_data);
|
||||
ExtendedKeyUsage_Id = ObjectIdentifier.newInternal(ExtendedKeyUsage_data);
|
||||
InhibitAnyPolicy_Id = ObjectIdentifier.newInternal(InhibitAnyPolicy_data);
|
||||
SubjectDirectoryAttributes_Id =
|
||||
ObjectIdentifier.newInternal(SubjectDirectoryAttributes_data);
|
||||
BasicConstraints_Id =
|
||||
ObjectIdentifier.newInternal(BasicConstraints_data);
|
||||
ReasonCode_Id = ObjectIdentifier.newInternal(ReasonCode_data);
|
||||
HoldInstructionCode_Id =
|
||||
ObjectIdentifier.newInternal(HoldInstructionCode_data);
|
||||
InvalidityDate_Id = ObjectIdentifier.newInternal(InvalidityDate_data);
|
||||
|
||||
NameConstraints_Id = ObjectIdentifier.newInternal(NameConstraints_data);
|
||||
PolicyConstraints_Id =
|
||||
ObjectIdentifier.newInternal(PolicyConstraints_data);
|
||||
CRLDistributionPoints_Id =
|
||||
ObjectIdentifier.newInternal(CRLDistributionPoints_data);
|
||||
CRLNumber_Id =
|
||||
ObjectIdentifier.newInternal(CRLNumber_data);
|
||||
IssuingDistributionPoint_Id =
|
||||
ObjectIdentifier.newInternal(IssuingDistributionPoint_data);
|
||||
DeltaCRLIndicator_Id =
|
||||
ObjectIdentifier.newInternal(DeltaCRLIndicator_data);
|
||||
CertificateIssuer_Id =
|
||||
ObjectIdentifier.newInternal(CertificateIssuer_data);
|
||||
AuthInfoAccess_Id =
|
||||
ObjectIdentifier.newInternal(AuthInfoAccess_data);
|
||||
SubjectInfoAccess_Id =
|
||||
ObjectIdentifier.newInternal(SubjectInfoAccess_data);
|
||||
FreshestCRL_Id = ObjectIdentifier.newInternal(FreshestCRL_data);
|
||||
OCSPNoCheck_Id = ObjectIdentifier.newInternal(OCSPNoCheck_data);
|
||||
OCSPNonce_Id = ObjectIdentifier.newInternal(OCSPNonce_data);
|
||||
}
|
||||
public static final ObjectIdentifier OCSPNonce_Id =
|
||||
ObjectIdentifier.of("1.3.6.1.5.5.7.48.1.2");
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -1102,104 +1102,83 @@ public class X500Name implements GeneralNameInterface, Principal {
|
|||
* Includes all those specified in RFC 5280 as MUST or SHOULD
|
||||
* be recognized
|
||||
*/
|
||||
private static final int[] commonName_data = { 2, 5, 4, 3 };
|
||||
private static final int[] SURNAME_DATA = { 2, 5, 4, 4 };
|
||||
private static final int[] SERIALNUMBER_DATA = { 2, 5, 4, 5 };
|
||||
private static final int[] countryName_data = { 2, 5, 4, 6 };
|
||||
private static final int[] localityName_data = { 2, 5, 4, 7 };
|
||||
private static final int[] stateName_data = { 2, 5, 4, 8 };
|
||||
private static final int[] streetAddress_data = { 2, 5, 4, 9 };
|
||||
private static final int[] orgName_data = { 2, 5, 4, 10 };
|
||||
private static final int[] orgUnitName_data = { 2, 5, 4, 11 };
|
||||
private static final int[] title_data = { 2, 5, 4, 12 };
|
||||
private static final int[] GIVENNAME_DATA = { 2, 5, 4, 42 };
|
||||
private static final int[] INITIALS_DATA = { 2, 5, 4, 43 };
|
||||
private static final int[] GENERATIONQUALIFIER_DATA = { 2, 5, 4, 44 };
|
||||
private static final int[] DNQUALIFIER_DATA = { 2, 5, 4, 46 };
|
||||
|
||||
private static final int[] ipAddress_data = { 1, 3, 6, 1, 4, 1, 42, 2, 11, 2, 1 };
|
||||
private static final int[] DOMAIN_COMPONENT_DATA =
|
||||
{ 0, 9, 2342, 19200300, 100, 1, 25 };
|
||||
private static final int[] userid_data =
|
||||
{ 0, 9, 2342, 19200300, 100, 1, 1 };
|
||||
|
||||
|
||||
// OID for the "CN=" attribute, denoting a person's common name.
|
||||
public static final ObjectIdentifier commonName_oid =
|
||||
ObjectIdentifier.newInternal(commonName_data);
|
||||
ObjectIdentifier.of("2.5.4.3");
|
||||
|
||||
// OID for the "SURNAME=" attribute, denoting a person's surname.
|
||||
public static final ObjectIdentifier SURNAME_OID =
|
||||
ObjectIdentifier.of("2.5.4.4");
|
||||
|
||||
// OID for the "SERIALNUMBER=" attribute, denoting a serial number for.
|
||||
// a name. Do not confuse with PKCS#9 issuerAndSerialNumber or the
|
||||
// certificate serial number.
|
||||
public static final ObjectIdentifier SERIALNUMBER_OID =
|
||||
ObjectIdentifier.newInternal(SERIALNUMBER_DATA);
|
||||
ObjectIdentifier.of("2.5.4.5");
|
||||
|
||||
// OID for the "C=" attribute, denoting a country.
|
||||
public static final ObjectIdentifier countryName_oid =
|
||||
ObjectIdentifier.newInternal(countryName_data);
|
||||
ObjectIdentifier.of("2.5.4.6");
|
||||
|
||||
// OID for the "L=" attribute, denoting a locality (such as a city).
|
||||
public static final ObjectIdentifier localityName_oid =
|
||||
ObjectIdentifier.newInternal(localityName_data);
|
||||
|
||||
// OID for the "O=" attribute, denoting an organization name.
|
||||
public static final ObjectIdentifier orgName_oid =
|
||||
ObjectIdentifier.newInternal(orgName_data);
|
||||
|
||||
// OID for the "OU=" attribute, denoting an organizational unit name.
|
||||
public static final ObjectIdentifier orgUnitName_oid =
|
||||
ObjectIdentifier.newInternal(orgUnitName_data);
|
||||
ObjectIdentifier.of("2.5.4.7");
|
||||
|
||||
// OID for the "S=" attribute, denoting a state (such as Delaware).
|
||||
public static final ObjectIdentifier stateName_oid =
|
||||
ObjectIdentifier.newInternal(stateName_data);
|
||||
ObjectIdentifier.of("2.5.4.8");
|
||||
|
||||
// OID for the "STREET=" attribute, denoting a street address.
|
||||
public static final ObjectIdentifier streetAddress_oid =
|
||||
ObjectIdentifier.newInternal(streetAddress_data);
|
||||
ObjectIdentifier.of("2.5.4.9");
|
||||
|
||||
// OID for the "O=" attribute, denoting an organization name.
|
||||
public static final ObjectIdentifier orgName_oid =
|
||||
ObjectIdentifier.of("2.5.4.10");
|
||||
|
||||
// OID for the "OU=" attribute, denoting an organizational unit name.
|
||||
public static final ObjectIdentifier orgUnitName_oid =
|
||||
ObjectIdentifier.of("2.5.4.11");
|
||||
|
||||
// OID for the "T=" attribute, denoting a person's title.
|
||||
public static final ObjectIdentifier title_oid =
|
||||
ObjectIdentifier.newInternal(title_data);
|
||||
ObjectIdentifier.of("2.5.4.12");
|
||||
|
||||
// OID for the "GIVENNAME=" attribute, denoting a person's given name.
|
||||
public static final ObjectIdentifier GIVENNAME_OID =
|
||||
ObjectIdentifier.of("2.5.4.42");
|
||||
|
||||
// OID for the "INITIALS=" attribute, denoting a person's initials.
|
||||
public static final ObjectIdentifier INITIALS_OID =
|
||||
ObjectIdentifier.of("2.5.4.43");
|
||||
|
||||
// OID for the "GENERATION=" attribute, denoting Jr., II, etc.
|
||||
public static final ObjectIdentifier GENERATIONQUALIFIER_OID =
|
||||
ObjectIdentifier.of("2.5.4.44");
|
||||
|
||||
// OID for the "DNQUALIFIER=" or "DNQ=" attribute, denoting DN
|
||||
// disambiguating information.
|
||||
public static final ObjectIdentifier DNQUALIFIER_OID =
|
||||
ObjectIdentifier.newInternal(DNQUALIFIER_DATA);
|
||||
|
||||
// OID for the "SURNAME=" attribute, denoting a person's surname.
|
||||
public static final ObjectIdentifier SURNAME_OID =
|
||||
ObjectIdentifier.newInternal(SURNAME_DATA);
|
||||
|
||||
// OID for the "GIVENNAME=" attribute, denoting a person's given name.
|
||||
public static final ObjectIdentifier GIVENNAME_OID =
|
||||
ObjectIdentifier.newInternal(GIVENNAME_DATA);
|
||||
|
||||
// OID for the "INITIALS=" attribute, denoting a person's initials.
|
||||
public static final ObjectIdentifier INITIALS_OID =
|
||||
ObjectIdentifier.newInternal(INITIALS_DATA);
|
||||
|
||||
// OID for the "GENERATION=" attribute, denoting Jr., II, etc.
|
||||
public static final ObjectIdentifier GENERATIONQUALIFIER_OID =
|
||||
ObjectIdentifier.newInternal(GENERATIONQUALIFIER_DATA);
|
||||
ObjectIdentifier.of("2.5.4.46");
|
||||
|
||||
// OIDs from other sources which show up in X.500 names we
|
||||
// expect to deal with often.
|
||||
//
|
||||
// OID for "IP=" IP address attributes, used with SKIP.
|
||||
public static final ObjectIdentifier ipAddress_oid =
|
||||
ObjectIdentifier.newInternal(ipAddress_data);
|
||||
ObjectIdentifier.of("1.3.6.1.4.1.42.2.11.2.1");
|
||||
|
||||
// Domain component OID from RFC 1274, RFC 2247, RFC 5280.
|
||||
//
|
||||
// OID for "DC=" domain component attributes, used with DNSNames in DN
|
||||
// OID for "DC=" domain component attributes.used with DNSNames in DN
|
||||
// format.
|
||||
public static final ObjectIdentifier DOMAIN_COMPONENT_OID =
|
||||
ObjectIdentifier.newInternal(DOMAIN_COMPONENT_DATA);
|
||||
ObjectIdentifier.of("0.9.2342.19200300.100.1.25");
|
||||
|
||||
// OID for "UID=" denoting a user id, defined in RFCs 1274 & 2798.
|
||||
public static final ObjectIdentifier userid_oid =
|
||||
ObjectIdentifier.newInternal(userid_data);
|
||||
ObjectIdentifier.of("0.9.2342.19200300.100.1.1");
|
||||
|
||||
/**
|
||||
* Return constraint type:<ul>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue