Class X509Util


  • class X509Util
    extends java.lang.Object
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) static class  X509Util.Implementation  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.Hashtable algorithms  
      private static java.util.Set noParams  
      private static java.util.Hashtable params  
    • Constructor Summary

      Constructors 
      Constructor Description
      X509Util()  
    • Field Detail

      • algorithms

        private static java.util.Hashtable algorithms
      • params

        private static java.util.Hashtable params
      • noParams

        private static java.util.Set noParams
    • Constructor Detail

      • X509Util

        X509Util()
    • Method Detail

      • getAlgorithmOID

        static DERObjectIdentifier getAlgorithmOID​(java.lang.String algorithmName)
      • getAlgNames

        static java.util.Iterator getAlgNames()
      • getSignatureInstance

        static java.security.Signature getSignatureInstance​(java.lang.String algorithm)
                                                     throws java.security.NoSuchAlgorithmException
        Throws:
        java.security.NoSuchAlgorithmException
      • getSignatureInstance

        static java.security.Signature getSignatureInstance​(java.lang.String algorithm,
                                                            java.lang.String provider)
                                                     throws java.security.NoSuchProviderException,
                                                            java.security.NoSuchAlgorithmException
        Throws:
        java.security.NoSuchProviderException
        java.security.NoSuchAlgorithmException
      • calculateSignature

        static byte[] calculateSignature​(DERObjectIdentifier sigOid,
                                         java.lang.String sigName,
                                         java.security.PrivateKey key,
                                         java.security.SecureRandom random,
                                         ASN1Encodable object)
                                  throws java.io.IOException,
                                         java.security.NoSuchAlgorithmException,
                                         java.security.InvalidKeyException,
                                         java.security.SignatureException
        Throws:
        java.io.IOException
        java.security.NoSuchAlgorithmException
        java.security.InvalidKeyException
        java.security.SignatureException
      • calculateSignature

        static byte[] calculateSignature​(DERObjectIdentifier sigOid,
                                         java.lang.String sigName,
                                         java.lang.String provider,
                                         java.security.PrivateKey key,
                                         java.security.SecureRandom random,
                                         ASN1Encodable object)
                                  throws java.io.IOException,
                                         java.security.NoSuchProviderException,
                                         java.security.NoSuchAlgorithmException,
                                         java.security.InvalidKeyException,
                                         java.security.SignatureException
        Throws:
        java.io.IOException
        java.security.NoSuchProviderException
        java.security.NoSuchAlgorithmException
        java.security.InvalidKeyException
        java.security.SignatureException
      • convertPrincipal

        static X509Principal convertPrincipal​(javax.security.auth.x500.X500Principal principal)
      • getImplementation

        static X509Util.Implementation getImplementation​(java.lang.String baseName,
                                                         java.lang.String algorithm,
                                                         java.security.Provider prov)
                                                  throws java.security.NoSuchAlgorithmException
        see if we can find an algorithm (or its alias and what it represents) in the property table for the given provider.
        Throws:
        java.security.NoSuchAlgorithmException
      • getImplementation

        static X509Util.Implementation getImplementation​(java.lang.String baseName,
                                                         java.lang.String algorithm)
                                                  throws java.security.NoSuchAlgorithmException
        return an implementation for a given algorithm/provider. If the provider is null, we grab the first avalaible who has the required algorithm.
        Throws:
        java.security.NoSuchAlgorithmException
      • getProvider

        static java.security.Provider getProvider​(java.lang.String provider)
                                           throws java.security.NoSuchProviderException
        Throws:
        java.security.NoSuchProviderException