Keine Cache-Version

Caching deaktiviert Standardeinstellung für diese Seite:aktiviert (code LNG204)
Wenn die Anzeige zu langsam ist, können Sie den Benutzermodus deaktivieren, um die zwischengespeicherte Version anzuzeigen.
javax.crypto

Class EncryptedPrivateKeyInfo


  • public class EncryptedPrivateKeyInfo
    extends Object
    This class implements the EncryptedPrivateKeyInfo type as defined in PKCS #8.

    Its ASN.1 definition is as follows:

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

      • EncryptedPrivateKeyInfo

        public EncryptedPrivateKeyInfo(byte[] encoded)
                                throws IOException
        Constructs (i.e., parses) an EncryptedPrivateKeyInfo from its ASN.1 encoding.
        Parameters:
        encoded - the ASN.1 encoding of this object. The contents of the array are copied to protect against subsequent modification.
        Throws:
        NullPointerException - if the encoded is null.
        IOException - if error occurs when parsing the ASN.1 encoding.
      • EncryptedPrivateKeyInfo

        public EncryptedPrivateKeyInfo(String algName,
                               byte[] encryptedData)
                                throws NoSuchAlgorithmException
        Constructs an EncryptedPrivateKeyInfo from the encryption algorithm name and the encrypted data.

        Note: This constructor will use null as the value of the algorithm parameters. If the encryption algorithm has parameters whose value is not null, a different constructor, e.g. EncryptedPrivateKeyInfo(AlgorithmParameters, byte[]), should be used.

        Parameters:
        algName - encryption algorithm name. See Appendix A in the Java Cryptography Architecture Reference Guide for information about standard Cipher algorithm names.
        encryptedData - encrypted data. The contents of encrypedData are copied to protect against subsequent modification when constructing this object.
        Throws:
        NullPointerException - if algName or encryptedData is null.
        IllegalArgumentException - if encryptedData is empty, i.e. 0-length.
        NoSuchAlgorithmException - if the specified algName is not supported.
      • EncryptedPrivateKeyInfo

        public EncryptedPrivateKeyInfo(AlgorithmParameters algParams,
                               byte[] encryptedData)
                                throws NoSuchAlgorithmException
        Constructs an EncryptedPrivateKeyInfo from the encryption algorithm parameters and the encrypted data.
        Parameters:
        algParams - the algorithm parameters for the encryption algorithm. algParams.getEncoded() should return the ASN.1 encoded bytes of the parameters field of the AlgorithmIdentifer component of the EncryptedPrivateKeyInfo type.
        encryptedData - encrypted data. The contents of encrypedData are copied to protect against subsequent modification when constructing this object.
        Throws:
        NullPointerException - if algParams or encryptedData is null.
        IllegalArgumentException - if encryptedData is empty, i.e. 0-length.
        NoSuchAlgorithmException - if the specified algName of the specified algParams parameter is not supported.
    • Method Detail

      • getAlgName

        public String getAlgName()
        Returns the encryption algorithm.

        Note: Standard name is returned instead of the specified one in the constructor when such mapping is available. See Appendix A in the Java Cryptography Architecture Reference Guide for information about standard Cipher algorithm names.

        Returns:
        the encryption algorithm name.
      • getAlgParameters

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

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

        public PKCS8EncodedKeySpec getKeySpec(Cipher cipher)
                                       throws InvalidKeySpecException
        Extract the enclosed PKCS8EncodedKeySpec object from the encrypted data and return it.
        Note: In order to successfully retrieve the enclosed PKCS8EncodedKeySpec object, cipher needs to be initialized to either Cipher.DECRYPT_MODE or Cipher.UNWRAP_MODE, with the same key and parameters used for generating the encrypted data.
        Parameters:
        cipher - the initialized cipher object which will be used for decrypting the encrypted data.
        Returns:
        the PKCS8EncodedKeySpec object.
        Throws:
        NullPointerException - if cipher is null.
        InvalidKeySpecException - if the given cipher is inappropriate for the encrypted data or the encrypted data is corrupted and cannot be decrypted.
      • getKeySpec

        public PKCS8EncodedKeySpec getKeySpec(Key decryptKey,
                                     Provider provider)
                                       throws NoSuchAlgorithmException,
                                              InvalidKeyException
        Extract the enclosed PKCS8EncodedKeySpec object from the encrypted data and return it.
        Parameters:
        decryptKey - key used for decrypting the encrypted data.
        provider - the name of provider whose Cipher implementation will be used.
        Returns:
        the PKCS8EncodedKeySpec object.
        Throws:
        NullPointerException - if decryptKey or provider is null.
        NoSuchAlgorithmException - if cannot find appropriate cipher to decrypt the encrypted data in provider.
        InvalidKeyException - if decryptKey cannot be used to decrypt the encrypted data or the decryption result is not a valid PKCS8KeySpec.
        Since:
        1.5
      • getEncoded

        public byte[] getEncoded()
                          throws IOException
        Returns the ASN.1 encoding of this object.
        Returns:
        the ASN.1 encoding. Returns a new array each time this method is called.
        Throws:
        IOException - if error occurs when constructing its ASN.1 encoding.

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 11/06/2005, zuletzt geändert 04/03/2020
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-rf-javax/crypto/encryptedprivatekeyinfo.html

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.

Referenzen

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:fr Manuel PHP : https://docs.oracle.com

Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor Diese Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.

Inhaltsverzeichnis Haut