Class OpensslTruststoreHelper


  • public class OpensslTruststoreHelper
    extends java.lang.Object
    Several static methods helping to mangle truststore file paths in openssl style.
    Author:
    K. Benedyczak
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String CERT_REGEXP  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OpensslTruststoreHelper

        public OpensslTruststoreHelper()
    • Method Detail

      • getNsFile

        public static java.lang.String getNsFile​(java.lang.String certLocation,
                                                 java.lang.String suffix)
        Parameters:
        certLocation - certificate location
        suffix - either '.namespaces' or '.signing_policy' (other will work but rather doesn't make sense)
        Returns:
        A proper name of a namespaces or signing policy file for the given base path of CA certificate.
      • getFileHash

        public static java.lang.String getFileHash​(java.lang.String path,
                                                   java.lang.String regexp)
      • getFilesWithRegexp

        public static java.util.Collection<java.io.File> getFilesWithRegexp​(java.lang.String regexp,
                                                                            java.io.File directory)
      • getOpenSSLCAHash

        public static java.lang.String getOpenSSLCAHash​(javax.security.auth.x500.X500Principal name,
                                                        boolean openssl1Mode)
      • getNormalizedRDNs

        public static org.bouncycastle.asn1.x500.RDN[] getNormalizedRDNs​(javax.security.auth.x500.X500Principal name)
                                                                  throws java.io.IOException
        Throws:
        java.io.IOException