Bouncy Castle Cryptography Library 1.49

org.bouncycastle.openssl
Class PKCS8Generator

java.lang.Object
  extended by org.bouncycastle.openssl.PKCS8Generator
All Implemented Interfaces:
org.bouncycastle.util.io.pem.PemObjectGenerator
Direct Known Subclasses:
JcaPKCS8Generator

public class PKCS8Generator
extends java.lang.Object
implements org.bouncycastle.util.io.pem.PemObjectGenerator


Field Summary
static org.bouncycastle.asn1.ASN1ObjectIdentifier AES_128_CBC
           
static org.bouncycastle.asn1.ASN1ObjectIdentifier AES_192_CBC
           
static org.bouncycastle.asn1.ASN1ObjectIdentifier AES_256_CBC
           
static org.bouncycastle.asn1.ASN1ObjectIdentifier DES3_CBC
           
static org.bouncycastle.asn1.ASN1ObjectIdentifier PBE_SHA1_2DES
           
static org.bouncycastle.asn1.ASN1ObjectIdentifier PBE_SHA1_3DES
           
static org.bouncycastle.asn1.ASN1ObjectIdentifier PBE_SHA1_RC2_128
           
static org.bouncycastle.asn1.ASN1ObjectIdentifier PBE_SHA1_RC2_40
           
static org.bouncycastle.asn1.ASN1ObjectIdentifier PBE_SHA1_RC4_128
           
static org.bouncycastle.asn1.ASN1ObjectIdentifier PBE_SHA1_RC4_40
           
 
Constructor Summary
PKCS8Generator(java.security.PrivateKey key)
          Deprecated. use JcaPKCS8Generator
PKCS8Generator(java.security.PrivateKey key, org.bouncycastle.asn1.ASN1ObjectIdentifier algorithm, java.security.Provider provider)
          Deprecated. use JcaPKCS8Generator
PKCS8Generator(java.security.PrivateKey key, org.bouncycastle.asn1.ASN1ObjectIdentifier algorithm, java.lang.String provider)
          Deprecated. use JcaPKCS8Generator
PKCS8Generator(org.bouncycastle.asn1.pkcs.PrivateKeyInfo key, OutputEncryptor outputEncryptor)
          Base constructor.
 
Method Summary
 org.bouncycastle.util.io.pem.PemObject generate()
           
 PKCS8Generator setIterationCount(int iterationCount)
          Deprecated. ignored in the updated case.
 PKCS8Generator setPassword(char[] password)
          Deprecated. ignored in the updated case.
 PKCS8Generator setSecureRandom(java.security.SecureRandom random)
          Deprecated. ignored in the updated case.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AES_128_CBC

public static final org.bouncycastle.asn1.ASN1ObjectIdentifier AES_128_CBC

AES_192_CBC

public static final org.bouncycastle.asn1.ASN1ObjectIdentifier AES_192_CBC

AES_256_CBC

public static final org.bouncycastle.asn1.ASN1ObjectIdentifier AES_256_CBC

DES3_CBC

public static final org.bouncycastle.asn1.ASN1ObjectIdentifier DES3_CBC

PBE_SHA1_RC4_128

public static final org.bouncycastle.asn1.ASN1ObjectIdentifier PBE_SHA1_RC4_128

PBE_SHA1_RC4_40

public static final org.bouncycastle.asn1.ASN1ObjectIdentifier PBE_SHA1_RC4_40

PBE_SHA1_3DES

public static final org.bouncycastle.asn1.ASN1ObjectIdentifier PBE_SHA1_3DES

PBE_SHA1_2DES

public static final org.bouncycastle.asn1.ASN1ObjectIdentifier PBE_SHA1_2DES

PBE_SHA1_RC2_128

public static final org.bouncycastle.asn1.ASN1ObjectIdentifier PBE_SHA1_RC2_128

PBE_SHA1_RC2_40

public static final org.bouncycastle.asn1.ASN1ObjectIdentifier PBE_SHA1_RC2_40
Constructor Detail

PKCS8Generator

public PKCS8Generator(java.security.PrivateKey key)
Deprecated. use JcaPKCS8Generator

Constructor for an unencrypted private key PEM object.

Parameters:
key - private key to be encoded.

PKCS8Generator

public PKCS8Generator(java.security.PrivateKey key,
                      org.bouncycastle.asn1.ASN1ObjectIdentifier algorithm,
                      java.lang.String provider)
               throws java.security.NoSuchProviderException,
                      java.security.NoSuchAlgorithmException
Deprecated. use JcaPKCS8Generator

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:
java.security.NoSuchProviderException - if provider cannot be found
java.security.NoSuchAlgorithmException - if algorithm/mode cannot be found

PKCS8Generator

public PKCS8Generator(java.security.PrivateKey key,
                      org.bouncycastle.asn1.ASN1ObjectIdentifier algorithm,
                      java.security.Provider provider)
               throws java.security.NoSuchAlgorithmException
Deprecated. use JcaPKCS8Generator

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:
java.security.NoSuchAlgorithmException - if algorithm/mode cannot be found

PKCS8Generator

public PKCS8Generator(org.bouncycastle.asn1.pkcs.PrivateKeyInfo key,
                      OutputEncryptor outputEncryptor)
Base constructor.

Method Detail

setSecureRandom

public PKCS8Generator setSecureRandom(java.security.SecureRandom random)
Deprecated. ignored in the updated case.


setPassword

public PKCS8Generator setPassword(char[] password)
Deprecated. ignored in the updated case.


setIterationCount

public PKCS8Generator setIterationCount(int iterationCount)
Deprecated. ignored in the updated case.


generate

public org.bouncycastle.util.io.pem.PemObject generate()
                                                throws org.bouncycastle.util.io.pem.PemGenerationException
Specified by:
generate in interface org.bouncycastle.util.io.pem.PemObjectGenerator
Throws:
org.bouncycastle.util.io.pem.PemGenerationException

Bouncy Castle Cryptography Library 1.49