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) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 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
|
||||
|
@ -157,34 +157,34 @@ public final class PKCS12KeyStore extends KeyStoreSpi {
|
|||
|
||||
private static final Debug debug = Debug.getInstance("pkcs12");
|
||||
|
||||
private static final int[] keyBag = {1, 2, 840, 113549, 1, 12, 10, 1, 2};
|
||||
private static final int[] certBag = {1, 2, 840, 113549, 1, 12, 10, 1, 3};
|
||||
private static final int[] secretBag = {1, 2, 840, 113549, 1, 12, 10, 1, 5};
|
||||
private static final ObjectIdentifier PKCS8ShroudedKeyBag_OID =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.12.10.1.2");
|
||||
private static final ObjectIdentifier CertBag_OID =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.12.10.1.3");
|
||||
private static final ObjectIdentifier SecretBag_OID =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.12.10.1.5");
|
||||
private static final ObjectIdentifier PKCS9FriendlyName_OID =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.9.20");
|
||||
private static final ObjectIdentifier PKCS9LocalKeyId_OID =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.9.21");
|
||||
private static final ObjectIdentifier PKCS9CertType_OID =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.9.22.1");
|
||||
private static final ObjectIdentifier pbes2_OID =
|
||||
ObjectIdentifier.of("1.2.840.113549.1.5.13");
|
||||
|
||||
private static final int[] pkcs9Name = {1, 2, 840, 113549, 1, 9, 20};
|
||||
private static final int[] pkcs9KeyId = {1, 2, 840, 113549, 1, 9, 21};
|
||||
|
||||
private static final int[] pkcs9certType = {1, 2, 840, 113549, 1, 9, 22, 1};
|
||||
|
||||
private static final int[] pbes2 = {1, 2, 840, 113549, 1, 5, 13};
|
||||
// TODO: temporary Oracle OID
|
||||
/*
|
||||
* { joint-iso-itu-t(2) country(16) us(840) organization(1) oracle(113894)
|
||||
* jdk(746875) crypto(1) id-at-trustedKeyUsage(1) }
|
||||
* Temporary Oracle OID
|
||||
*
|
||||
* {joint-iso-itu-t(2) country(16) us(840) organization(1)
|
||||
* oracle(113894) jdk(746875) crypto(1) id-at-trustedKeyUsage(1)}
|
||||
*/
|
||||
private static final int[] TrustedKeyUsage =
|
||||
{2, 16, 840, 1, 113894, 746875, 1, 1};
|
||||
private static final int[] AnyExtendedKeyUsage = {2, 5, 29, 37, 0};
|
||||
private static final ObjectIdentifier TrustedKeyUsage_OID =
|
||||
ObjectIdentifier.of("2.16.840.1.113894.746875.1.1");
|
||||
|
||||
private static final ObjectIdentifier PKCS8ShroudedKeyBag_OID;
|
||||
private static final ObjectIdentifier CertBag_OID;
|
||||
private static final ObjectIdentifier SecretBag_OID;
|
||||
private static final ObjectIdentifier PKCS9FriendlyName_OID;
|
||||
private static final ObjectIdentifier PKCS9LocalKeyId_OID;
|
||||
private static final ObjectIdentifier PKCS9CertType_OID;
|
||||
private static final ObjectIdentifier pbes2_OID;
|
||||
private static final ObjectIdentifier TrustedKeyUsage_OID;
|
||||
private static final ObjectIdentifier[] AnyUsage;
|
||||
private static final ObjectIdentifier[] AnyUsage = new ObjectIdentifier[] {
|
||||
// AnyExtendedKeyUsage
|
||||
ObjectIdentifier.of("2.5.29.37.0")
|
||||
};
|
||||
|
||||
private int counter = 0;
|
||||
|
||||
|
@ -213,23 +213,6 @@ public final class PKCS12KeyStore extends KeyStoreSpi {
|
|||
// the source of randomness
|
||||
private SecureRandom random;
|
||||
|
||||
static {
|
||||
try {
|
||||
PKCS8ShroudedKeyBag_OID = new ObjectIdentifier(keyBag);
|
||||
CertBag_OID = new ObjectIdentifier(certBag);
|
||||
SecretBag_OID = new ObjectIdentifier(secretBag);
|
||||
PKCS9FriendlyName_OID = new ObjectIdentifier(pkcs9Name);
|
||||
PKCS9LocalKeyId_OID = new ObjectIdentifier(pkcs9KeyId);
|
||||
PKCS9CertType_OID = new ObjectIdentifier(pkcs9certType);
|
||||
pbes2_OID = new ObjectIdentifier(pbes2);
|
||||
TrustedKeyUsage_OID = new ObjectIdentifier(TrustedKeyUsage);
|
||||
AnyUsage = new ObjectIdentifier[]{
|
||||
new ObjectIdentifier(AnyExtendedKeyUsage)};
|
||||
} catch (IOException ioe) {
|
||||
throw new AssertionError("OID not initialized", ioe);
|
||||
}
|
||||
}
|
||||
|
||||
// A keystore entry and associated attributes
|
||||
private static class Entry {
|
||||
Date date; // the creation date of this entry
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue