org.bouncycastle.openpgp

## Class PGPPublicKeyEncryptedData

- java.lang.Object
- - org.bouncycastle.openpgp.PGPEncryptedData
  - - org.bouncycastle.openpgp.PGPPublicKeyEncryptedData

All Implemented Interfaces:
  SymmetricKeyAlgorithmTags

    public class PGPPublicKeyEncryptedData
    extends PGPEncryptedData

A public key encrypted data object.

### Nested Class Summary

### Nested classes/interfaces inherited from class org.bouncycastle.openpgp.PGPEncryptedData

`PGPEncryptedData.TruncatedStream`

### Field Summary

### Fields inherited from interface org.bouncycastle.bcpg.SymmetricKeyAlgorithmTags

`AES_128, AES_192, AES_256, BLOWFISH, CAST5, DES, IDEA, NULL, SAFER, TRIPLE_DES, TWOFISH`

### Method Summary

Methods
`java.io.InputStream` `getDataStream(PGPPrivateKey privKey, java.security.Provider provider)`
`java.io.InputStream` `getDataStream(PGPPrivateKey privKey, java.security.Provider asymProvider, java.security.Provider provider)`
`java.io.InputStream` `getDataStream(PGPPrivateKey privKey, java.lang.String provider)` Return the decrypted data stream for the packet.
`java.io.InputStream` `getDataStream(PGPPrivateKey privKey, java.lang.String asymProvider, java.lang.String provider)` Return the decrypted data stream for the packet.
`long` `getKeyID()` Return the keyID for the key used to encrypt the data.
`int` `getSymmetricAlgorithm(PGPPrivateKey privKey, java.security.Provider provider)`
`int` `getSymmetricAlgorithm(PGPPrivateKey privKey, java.lang.String provider)` Return the algorithm code for the symmetric algorithm used to encrypt the data.

### Methods inherited from class org.bouncycastle.openpgp.PGPEncryptedData

`getInputStream, isIntegrityProtected, verify`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### getKeyID

    public long getKeyID()

Return the keyID for the key used to encrypt the data.

Returns:
  long

#### getSymmetricAlgorithm

    public int getSymmetricAlgorithm(PGPPrivateKey privKey,
                            java.lang.String provider)
                              throws PGPException,
                                     java.security.NoSuchProviderException

Return the algorithm code for the symmetric algorithm used to encrypt the data.

Returns:
  integer algorithm code
Throws:
  `PGPException`
  `java.security.NoSuchProviderException`

#### getSymmetricAlgorithm

    public int getSymmetricAlgorithm(PGPPrivateKey privKey,
                            java.security.Provider provider)
                              throws PGPException,
                                     java.security.NoSuchProviderException

Throws:
  `PGPException`
  `java.security.NoSuchProviderException`

#### getDataStream

    public java.io.InputStream getDataStream(PGPPrivateKey privKey,
                                    java.lang.String provider)
                                      throws PGPException,
                                             java.security.NoSuchProviderException

Return the decrypted data stream for the packet.

Parameters:
  `privKey` - private key to use
  `provider` - provider to use for private key and symmetric key decryption.
Returns:
  InputStream
Throws:
  `PGPException`
  `java.security.NoSuchProviderException`

#### getDataStream

    public java.io.InputStream getDataStream(PGPPrivateKey privKey,
                                    java.security.Provider provider)
                                      throws PGPException

Throws:
  `PGPException`

#### getDataStream

    public java.io.InputStream getDataStream(PGPPrivateKey privKey,
                                    java.lang.String asymProvider,
                                    java.lang.String provider)
                                      throws PGPException,
                                             java.security.NoSuchProviderException

Return the decrypted data stream for the packet.

Parameters:
  `privKey` - private key to use.
  `asymProvider` - asymetric provider to use with private key.
  `provider` - provider to use for symmetric algorithm.
Returns:
  InputStream
Throws:
  `PGPException`
  `java.security.NoSuchProviderException`

#### getDataStream

    public java.io.InputStream getDataStream(PGPPrivateKey privKey,
                                    java.security.Provider asymProvider,
                                    java.security.Provider provider)
                                      throws PGPException

Throws:
  `PGPException`