org.glite.slcs.pki.bouncycastle
Class PKCS10

java.lang.Object
  extended by org.glite.slcs.pki.bouncycastle.PKCS10

public class PKCS10
extends java.lang.Object

PKCS10 wrapper class for the BouncyCastle PKCS10CertificationRequest object.

Version:
$Revision: 1.3 $
Author:
Valery Tschopp

Field Summary
static java.lang.String SIGNATURE_ALGORITHM
          Signature algorithm for the PKCS#10 request
 
Constructor Summary
PKCS10(java.lang.String subject, java.security.PublicKey publicKey, java.security.PrivateKey privateKey)
           
PKCS10(java.lang.String subject, java.security.PublicKey publicKey, java.security.PrivateKey privateKey, org.bouncycastle.asn1.x509.X509Extensions x509Extensions)
           
 
Method Summary
 byte[] getDEREncoded()
           
 java.lang.String getPEMEncoded()
           
 java.security.Principal getPrincipal()
           
 java.lang.String getSubject()
           
 org.bouncycastle.asn1.x509.X509Extensions getX509Extensions()
          Gets the X509Extensions included in the PKCS10.
static PKCS10 readPEMEncoded(java.io.Reader reader)
          Reads the PKCS10 from a reader.
 void storeDEREncoded(java.io.File file)
          Stores the DER encoded PKCS#10 in a file.
 void storePEMEncoded(java.io.File file)
          Stores the PCKS10 in PEM format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIGNATURE_ALGORITHM

public static java.lang.String SIGNATURE_ALGORITHM
Signature algorithm for the PKCS#10 request

Constructor Detail

PKCS10

public PKCS10(java.lang.String subject,
              java.security.PublicKey publicKey,
              java.security.PrivateKey privateKey)
       throws java.security.GeneralSecurityException
Parameters:
subject -
publicKey -
privateKey -
Throws:
java.security.GeneralSecurityException

PKCS10

public PKCS10(java.lang.String subject,
              java.security.PublicKey publicKey,
              java.security.PrivateKey privateKey,
              org.bouncycastle.asn1.x509.X509Extensions x509Extensions)
       throws java.security.GeneralSecurityException
Parameters:
subject -
publicKey -
privateKey -
x509Extensions -
Throws:
java.security.GeneralSecurityException
Method Detail

getDEREncoded

public byte[] getDEREncoded()
Returns:
The DER encoded byte array.

getPEMEncoded

public java.lang.String getPEMEncoded()
Returns:
The PEM encoded string representation.

storePEMEncoded

public void storePEMEncoded(java.io.File file)
                     throws java.io.IOException
Stores the PCKS10 in PEM format. This is OpenSSL compatible.

Parameters:
file - The file to store into.
Throws:
java.io.IOException

storeDEREncoded

public void storeDEREncoded(java.io.File file)
                     throws java.io.IOException
Stores the DER encoded PKCS#10 in a file.

Parameters:
file - The file to store into.
Throws:
java.io.IOException

readPEMEncoded

public static PKCS10 readPEMEncoded(java.io.Reader reader)
                             throws java.io.IOException,
                                    java.security.GeneralSecurityException
Reads the PKCS10 from a reader. This is OpenSSL compatible.

Parameters:
reader -
Returns:
Throws:
java.io.IOException
java.security.GeneralSecurityException
See Also:
Reader

getSubject

public java.lang.String getSubject()
Returns:
The subject DN as string.

getPrincipal

public java.security.Principal getPrincipal()
Returns:
The subject DN as Principal

getX509Extensions

public org.bouncycastle.asn1.x509.X509Extensions getX509Extensions()
Gets the X509Extensions included in the PKCS10.

Returns:
The X509Extensions or null if there is no X509Extensions.