Overview | Package | Class | Tree | Deprecated | Index | Help
| Bouncy Castle Cryptography 1.20
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.bouncycastle.openpgp
Class PGPUtil

    java.lang.Object
      |
      +--org.bouncycastle.openpgp.PGPUtil

public class PGPUtil
extends java.lang.Object

Basic utility class

Constructor Summary
`PGPUtil()`

Method Summary
`static java.lang.String` | `getDefaultProvider()` Return the provider that will be used by factory classes in situations where a provider must be determined on the fly.
`static SecretKey` | `makeKeyFromPassPhrase(int algorithm, char[] passPhrase, java.lang.String provider)`
`static SecretKey` | `makeKeyFromPassPhrase(int algorithm, S2K s2k, char[] passPhrase, java.lang.String provider)`
`static SecretKey` | `makeRandomKey(int algorithm, java.security.SecureRandom random)`
`static void` | `setDefaultProvider(java.lang.String provider)` Set the provider to be used by the package when it is necessary to find one on the fly.
`static void` | `writeFileToLiteralData(java.io.OutputStream out, char fileType, java.io.File file)` write out the passed in file as a literal data packet.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PGPUtil

    public PGPUtil()

Method Detail

### getDefaultProvider

    public static java.lang.String getDefaultProvider()

  Return the provider that will be used by factory classes in situations where a provider must be determined on the fly.

  Returns:
    String

### setDefaultProvider

    public static void setDefaultProvider(java.lang.String provider)

  Set the provider to be used by the package when it is necessary to find one on the fly.

  Parameters:
    `provider` -

### makeRandomKey

    public static SecretKey makeRandomKey(int algorithm,
                                          java.security.SecureRandom random)
                                   throws PGPException

    `PGPException`

### makeKeyFromPassPhrase

    public static SecretKey makeKeyFromPassPhrase(int algorithm,
                                                  char[] passPhrase,
                                                  java.lang.String provider)
                                           throws java.security.NoSuchProviderException,
                                                  PGPException

    `java.security.NoSuchProviderException`
    `PGPException`

### makeKeyFromPassPhrase

    public static SecretKey makeKeyFromPassPhrase(int algorithm,
                                                  S2K s2k,
                                                  char[] passPhrase,
                                                  java.lang.String provider)
                                           throws PGPException,
                                                  java.security.NoSuchProviderException

    `PGPException`
    `java.security.NoSuchProviderException`

### writeFileToLiteralData

    public static void writeFileToLiteralData(java.io.OutputStream out,
                                              char fileType,
                                              java.io.File file)
                                       throws java.io.IOException

  write out the passed in file as a literal data packet.

  Parameters:
    `file` -
    `fileType` - the LiteralData type for the file.
    `out` -
  Throws:
    `java.io.IOException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Bouncy Castle Cryptography 1.20
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD