public class

PKCS8Generator

extends Object
implements PemObjectGenerator
java.lang.Object
   ↳ org.bouncycastle.openssl.PKCS8Generator

Summary

Fields
public static final String AES_128_CBC
public static final String AES_192_CBC
public static final String AES_256_CBC
public static final String DES3_CBC
public static final String PBE_SHA1_2DES
public static final String PBE_SHA1_3DES
public static final String PBE_SHA1_RC2_128
public static final String PBE_SHA1_RC2_40
public static final String PBE_SHA1_RC4_128
public static final String PBE_SHA1_RC4_40
Public Constructors
PKCS8Generator(PrivateKey key)
Constructor for an unencrypted private key PEM object.
PKCS8Generator(PrivateKey key, String algorithm, String provider)
Constructor for an encrypted private key PEM object.
PKCS8Generator(PrivateKey key, String algorithm, Provider provider)
Constructor for an encrypted private key PEM object.
Public Methods
PemObject generate()
PKCS8Generator setIterationCount(int iterationCount)
PKCS8Generator setPassword(char[] password)
PKCS8Generator setSecureRandom(SecureRandom random)
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.bouncycastle.util.io.pem.PemObjectGenerator

Fields

public static final String AES_128_CBC

public static final String AES_192_CBC

public static final String AES_256_CBC

public static final String DES3_CBC

public static final String PBE_SHA1_2DES

public static final String PBE_SHA1_3DES

public static final String PBE_SHA1_RC2_128

public static final String PBE_SHA1_RC2_40

public static final String PBE_SHA1_RC4_128

public static final String PBE_SHA1_RC4_40

Public Constructors

public PKCS8Generator (PrivateKey key)

Constructor for an unencrypted private key PEM object.

Parameters
key private key to be encoded.

public PKCS8Generator (PrivateKey key, String algorithm, String provider)

Constructor for an encrypted private key PEM object.

Parameters
key private key to be encoded
algorithm encryption algorithm to use
provider name of provider to use
Throws
NoSuchProviderException if provider cannot be found
NoSuchAlgorithmException if algorithm/mode cannot be found

public PKCS8Generator (PrivateKey key, String algorithm, Provider provider)

Constructor for an encrypted private key PEM object.

Parameters
key private key to be encoded
algorithm encryption algorithm to use
provider provider to use
Throws
NoSuchAlgorithmException if algorithm/mode cannot be found

Public Methods

public PemObject generate ()

public PKCS8Generator setIterationCount (int iterationCount)

public PKCS8Generator setPassword (char[] password)

public PKCS8Generator setSecureRandom (SecureRandom random)