Class PKCS12Util


  • @Deprecated
    public class PKCS12Util
    extends java.lang.Object
    Deprecated.
    Replaced by org.bouncycastle.pkcs.util.PKCS12Util; this class does not understand RFC 9579 PBMAC1-protected PKCS#12 files (it throws UnsupportedOperationException for them) and will be removed in a future release.
    Utility class for re-encoding PKCS#12 files to definite length.
    • Constructor Summary

      Constructors 
      Constructor Description
      PKCS12Util()
      Deprecated.
       
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static byte[] convertToDefiniteLength​(byte[] berPKCS12File)
      Deprecated.
      Just re-encode the outer layer of the PKCS#12 file to definite length encoding.
      static byte[] convertToDefiniteLength​(byte[] berPKCS12File, char[] passwd)
      Deprecated.
      Re-encode the PKCS#12 structure to definite length encoding at the inner layer as well, recomputing the MAC accordingly.
      static byte[] convertToDefiniteLength​(byte[] berPKCS12File, char[] passwd, java.lang.String provider)
      Deprecated.
      Re-encode the PKCS#12 structure to definite length encoding at the inner layer as well, recomputing the MAC accordingly.
      static byte[] convertToDefiniteLength​(byte[] berPKCS12File, char[] passwd, java.security.Provider provider)
      Deprecated.
      Re-encode the PKCS#12 structure to definite length encoding at the inner layer as well, recomputing the MAC accordingly.
      static ASN1Encodable getContent​(ContentInfo contentInfo)
      Deprecated.
       
      static byte[] getContentOctets​(ContentInfo contentInfo)
      Deprecated.
       
      static ASN1OctetString getEncryptedContent​(EncryptedData encryptedData)
      Deprecated.
       
      static int validateIterationCount​(java.math.BigInteger ic)
      Deprecated.
       
      • Methods inherited from class java.lang.Object

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

      • PKCS12Util

        public PKCS12Util()
        Deprecated.
    • Method Detail

      • convertToDefiniteLength

        public static byte[] convertToDefiniteLength​(byte[] berPKCS12File)
                                              throws java.io.IOException
        Deprecated.
        Just re-encode the outer layer of the PKCS#12 file to definite length encoding.
        Parameters:
        berPKCS12File - - original PKCS#12 file
        Returns:
        a byte array representing the DER encoding of the PFX structure
        Throws:
        java.io.IOException
      • convertToDefiniteLength

        public static byte[] convertToDefiniteLength​(byte[] berPKCS12File,
                                                     char[] passwd)
                                              throws java.io.IOException
        Deprecated.
        Re-encode the PKCS#12 structure to definite length encoding at the inner layer as well, recomputing the MAC accordingly.
        Parameters:
        berPKCS12File - - original PKCS12 file.
        Returns:
        a byte array representing the DER encoding of the PFX structure.
        Throws:
        java.io.IOException - on parsing, encoding errors.
      • convertToDefiniteLength

        public static byte[] convertToDefiniteLength​(byte[] berPKCS12File,
                                                     char[] passwd,
                                                     java.lang.String provider)
                                              throws java.io.IOException
        Deprecated.
        Re-encode the PKCS#12 structure to definite length encoding at the inner layer as well, recomputing the MAC accordingly.
        Parameters:
        berPKCS12File - - original PKCS12 file.
        provider - - provider name to use for MAC calculation.
        Returns:
        a byte array representing the DER encoding of the PFX structure.
        Throws:
        java.io.IOException - on parsing, encoding errors.
      • convertToDefiniteLength

        public static byte[] convertToDefiniteLength​(byte[] berPKCS12File,
                                                     char[] passwd,
                                                     java.security.Provider provider)
                                              throws java.io.IOException
        Deprecated.
        Re-encode the PKCS#12 structure to definite length encoding at the inner layer as well, recomputing the MAC accordingly.
        Parameters:
        berPKCS12File - - original PKCS12 file.
        provider - - provider to use for MAC calculation.
        Returns:
        a byte array representing the DER encoding of the PFX structure.
        Throws:
        java.io.IOException - on parsing, encoding errors.
      • getContent

        public static ASN1Encodable getContent​(ContentInfo contentInfo)
                                        throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • getContentOctets

        public static byte[] getContentOctets​(ContentInfo contentInfo)
                                       throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • getEncryptedContent

        public static ASN1OctetString getEncryptedContent​(EncryptedData encryptedData)
                                                   throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • validateIterationCount

        public static int validateIterationCount​(java.math.BigInteger ic)
        Deprecated.