Class JceAsymmetricKeyWrapper

    • Constructor Detail

      • JceAsymmetricKeyWrapper

        public JceAsymmetricKeyWrapper​(java.security.PublicKey publicKey)
      • JceAsymmetricKeyWrapper

        public JceAsymmetricKeyWrapper​(java.security.cert.X509Certificate certificate)
      • JceAsymmetricKeyWrapper

        public JceAsymmetricKeyWrapper​(org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier,
                                       java.security.PublicKey publicKey)
        Create a wrapper, overriding the algorithm type that is stored in the public key.
        Parameters:
        algorithmIdentifier - identifier for encryption algorithm to be used.
        publicKey - the public key to be used.
      • JceAsymmetricKeyWrapper

        public JceAsymmetricKeyWrapper​(java.security.AlgorithmParameters algorithmParams,
                                       java.security.PublicKey publicKey)
                                throws java.security.spec.InvalidParameterSpecException
        Create a wrapper, overriding the algorithm type that is stored in the public key.
        Parameters:
        algorithmParams - algorithm parameters for encryption algorithm to be used.
        publicKey - the public key to be used.
        Throws:
        java.security.spec.InvalidParameterSpecException
      • JceAsymmetricKeyWrapper

        public JceAsymmetricKeyWrapper​(java.security.spec.AlgorithmParameterSpec algorithmParameterSpec,
                                       java.security.PublicKey publicKey)
        Create a wrapper, overriding the algorithm type that is stored in the public key.
        Parameters:
        algorithmParameterSpec - the parameterSpec for encryption algorithm to be used.
        publicKey - the public key to be used.
    • Method Detail

      • setAlgorithmMapping

        public JceAsymmetricKeyWrapper setAlgorithmMapping​(org.bouncycastle.asn1.ASN1ObjectIdentifier algorithm,
                                                           java.lang.String algorithmName)
        Internally algorithm ids are converted into cipher names using a lookup table. For some providers the standard lookup table won't work. Use this method to establish a specific mapping from an algorithm identifier to a specific algorithm.

        For example:

             unwrapper.setAlgorithmMapping(PKCSObjectIdentifiers.rsaEncryption, "RSA");
         
        Parameters:
        algorithm - OID of algorithm in recipient.
        algorithmName - JCE algorithm name to use.
        Returns:
        the current Wrapper.