public class OpensslTruststoreHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CERT_REGEXP |
Constructor and Description |
---|
OpensslTruststoreHelper() |
Modifier and Type | Method and Description |
---|---|
private static byte[] |
encodeWithoutSeqHeader(org.bouncycastle.asn1.x500.RDN[] rdns) |
static java.lang.String |
getFileHash(java.lang.String path,
java.lang.String regexp) |
static java.util.Collection<java.io.File> |
getFilesWithRegexp(java.lang.String regexp,
java.io.File directory) |
static org.bouncycastle.asn1.x500.RDN[] |
getNormalizedRDNs(javax.security.auth.x500.X500Principal name) |
static java.lang.String |
getNsFile(java.lang.String certLocation,
java.lang.String suffix) |
static java.lang.String |
getOpenSSLCAHash(javax.security.auth.x500.X500Principal name,
boolean openssl1Mode) |
private static java.lang.String |
getOpenSSLCAHashNew(javax.security.auth.x500.X500Principal name)
Generates the hex hash of the DN used by openssl 1.0.0 and above to name the CA
certificate files.
|
private static java.lang.String |
getOpenSSLCAHashOld(javax.security.auth.x500.X500Principal name)
Generates the hex hash of the DN used by openssl to name the CA
certificate files.
|
private static int |
memcmp(byte[] a,
byte[] b) |
private static org.bouncycastle.asn1.x500.AttributeTypeAndValue |
normalizeStringAVA(org.bouncycastle.asn1.x500.AttributeTypeAndValue src) |
private static void |
sortAVAs(org.bouncycastle.asn1.x500.AttributeTypeAndValue[] atvs) |
public static final java.lang.String CERT_REGEXP
public static java.lang.String getNsFile(java.lang.String certLocation, java.lang.String suffix)
certLocation
- certificate locationsuffix
- either '.namespaces' or '.signing_policy' (other will work but rather doesn't make sense)public static java.lang.String getFileHash(java.lang.String path, java.lang.String regexp)
public static java.util.Collection<java.io.File> getFilesWithRegexp(java.lang.String regexp, java.io.File directory)
public static java.lang.String getOpenSSLCAHash(javax.security.auth.x500.X500Principal name, boolean openssl1Mode)
private static java.lang.String getOpenSSLCAHashOld(javax.security.auth.x500.X500Principal name)
name
- the DN to hash.private static java.lang.String getOpenSSLCAHashNew(javax.security.auth.x500.X500Principal name)
The normalization is performed as follows: all strings are converted to UTF8, leading, trailing and multiple spaces collapsed, converted to lower case and the leading SEQUENCE header is removed.
name
- the DN to hash.public static org.bouncycastle.asn1.x500.RDN[] getNormalizedRDNs(javax.security.auth.x500.X500Principal name) throws java.io.IOException
java.io.IOException
private static void sortAVAs(org.bouncycastle.asn1.x500.AttributeTypeAndValue[] atvs) throws java.io.IOException
java.io.IOException
private static int memcmp(byte[] a, byte[] b)
private static org.bouncycastle.asn1.x500.AttributeTypeAndValue normalizeStringAVA(org.bouncycastle.asn1.x500.AttributeTypeAndValue src)
private static byte[] encodeWithoutSeqHeader(org.bouncycastle.asn1.x500.RDN[] rdns) throws java.io.IOException
java.io.IOException