IT. Expert System.

Android Reference

EncryptedPrivateKeyInfo


javax.crypto

Class EncryptedPrivateKeyInfo



  • public class EncryptedPrivateKeyInfo
    extends Object
    This class implements the EncryptedPrivateKeyInfo ASN.1 type as specified in PKCS #8 - Private-Key Information Syntax Standard.

    The definition of ASN.1 is as follows:

    EncryptedPrivateKeyInfo ::= SEQUENCE {
    encryptionAlgorithm AlgorithmIdentifier,
    encryptedData OCTET STRING }
    AlgorithmIdentifier ::= SEQUENCE {
    algorithm OBJECT IDENTIFIER,
    parameters ANY DEFINED BY algorithm OPTIONAL }
    • Constructor Detail

      • EncryptedPrivateKeyInfo

        public EncryptedPrivateKeyInfo(byte[] encoded)
                                throws IOException
        Creates an EncryptedPrivateKeyInfo instance from its encoded representation by parsing it.
        Parameters:
        encoded - the encoded representation of this object
        Throws:
        IOException - if parsing the encoded representation fails.
        NullPointerException - if encoded is null.
      • EncryptedPrivateKeyInfo

        public EncryptedPrivateKeyInfo(String encryptionAlgorithmName,
                               byte[] encryptedData)
                                throws NoSuchAlgorithmException
        Creates an EncryptedPrivateKeyInfo instance from an algorithm name and its encrypted data.
        Parameters:
        encryptionAlgorithmName - the name of an algorithm.
        encryptedData - the encrypted data.
        Throws:
        NoSuchAlgorithmException - if the encrAlgName is not a supported algorithm.
        NullPointerException - if encrAlgName or encryptedData is null.
        IllegalArgumentException - if encryptedData is empty.
      • EncryptedPrivateKeyInfo

        public EncryptedPrivateKeyInfo(AlgorithmParameters algParams,
                               byte[] encryptedData)
                                throws NoSuchAlgorithmException
        Creates an EncryptedPrivateKeyInfo instance from the encryption algorithm parameters an its encrypted data.
        Parameters:
        algParams - the encryption algorithm parameters.
        encryptedData - the encrypted data.
        Throws:
        NoSuchAlgorithmException - if the algorithm name of the specified algParams parameter is not supported.
        NullPointerException - if algParams or encryptedData is null.
    • Method Detail

      • getAlgName

        public String getAlgName()
        Returns the name of the encryption algorithm.
        Returns:
        the name of the encryption algorithm.
      • getAlgParameters

        public AlgorithmParameters getAlgParameters()
        Returns the parameters used by the encryption algorithm.
        Returns:
        the parameters used by the encryption algorithm.
      • getEncryptedData

        public byte[] getEncryptedData()
        Returns the encrypted data of this key.
        Returns:
        the encrypted data of this key, each time this method is called a new array is returned.
      • getKeySpec

        public PKCS8EncodedKeySpec getKeySpec(Cipher cipher)
                                       throws InvalidKeySpecException
        Returns the PKCS8EncodedKeySpec object extracted from the encrypted data.

        The cipher must be initialize in either Cipher.DECRYPT_MODE or Cipher.UNWRAP_MODE with the same parameters and key used for encrypting this.

        Parameters:
        cipher - the cipher initialized for decrypting the encrypted data.
        Returns:
        the extracted PKCS8EncodedKeySpec.
        Throws:
        InvalidKeySpecException - if the specified cipher is not suited to decrypt the encrypted data.
        NullPointerException - if cipher is null.
      • getEncoded

        public byte[] getEncoded()
                          throws IOException
        Returns the ASN.1 encoded representation of this object.
        Returns:
        the ASN.1 encoded representation of this object.
        Throws:
        IOException - if encoding this object fails.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 343 / 158678005. Delta: 0.04118 с