Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

edu.virtualschool.jco.unfinished.JCODHPrivateKey Class Reference

Inheritance diagram for edu.virtualschool.jco.unfinished.JCODHPrivateKey:

edu.virtualschool.jco.JCOAsymmetricKey edu.virtualschool.jco.JCOKey Collaboration diagram for edu.virtualschool.jco.unfinished.JCODHPrivateKey:

Collaboration graph
[legend]
List of all members.

Detailed Description

Diffie Helman Private Keys as implemented via the BouncyCastle RSAPrivateCrtKey lightweight engine. The encoding format is PKCS#8.
Author:
bcox
See also:
JCODHPublicKey

JCODHKeyPair

JCODHAsymmetricKey

Definition at line 33 of file JCODHPrivateKey.java.

Public Member Functions

JCOEncodedBytes encode ()
JCOSignedBytes sign (Serializable object) throws JCOFault
byte[] encryptBytes (byte[] inputBytes) throws JCOFault
byte[] decryptBytes (byte[] inputBytes) throws JCOFault
DHParameters getParams ()
BigInteger getX ()
final String getAlgorithm ()
String getFormat ()
byte[] getEncoded ()
final AsymmetricKeyParameter getParameters ()

Package Functions

 JCODHPrivateKey (DHPrivateKeyParameters key)


Member Function Documentation

JCOEncodedBytes edu.virtualschool.jco.unfinished.JCODHPrivateKey.encode  ) 
 

Construct an encoded representation of this object suitable for disk storage.

Implements edu.virtualschool.jco.JCOKey.

Definition at line 79 of file JCODHPrivateKey.java.

References edu.virtualschool.jco.unfinished.JCODHPrivateKey.getEncoded().

00080   {
00081     return new JCOEncodedBytes(getEncoded()); 
00082   }

final String edu.virtualschool.jco.unfinished.JCODHPrivateKey.getAlgorithm  ) 
 

Returns the standard algorithm name for this key. For example, "DSA" would indicate that this key is a DSA key. See Appendix A in the Java Cryptography Architecture API Specification & Reference for information about standard algorithm names.

Returns:
the name of the algorithm associated with this key.

Implements edu.virtualschool.jco.JCOKey.

Definition at line 131 of file JCODHPrivateKey.java.

00132   {
00133     return "DH"; 
00134   }

byte [] edu.virtualschool.jco.unfinished.JCODHPrivateKey.getEncoded  ) 
 

Returns the key in its primary encoding format, or null if this key does not support encoding.

Returns:
the encoded key, or null if the key does not support encoding.

Implements edu.virtualschool.jco.JCOKey.

Definition at line 139 of file JCODHPrivateKey.java.

Referenced by edu.virtualschool.jco.unfinished.JCODHPrivateKey.encode().

00140   {
00141       ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
00142       DEROutputStream dOut = new DEROutputStream(bOut);
00143       DHParameter dhp = new DHParameter(params.getP(), params.getG(), 0);
00144       AlgorithmIdentifier aid = new AlgorithmIdentifier(PKCSObjectIdentifiers.dhKeyAgreement, dhp.getDERObject());
00145       PrivateKeyInfo info = new PrivateKeyInfo(aid, new DERInteger(getX()));
00146       try
00147       {
00148         dOut.writeObject(info);
00149         dOut.close();
00150         return bOut.toByteArray();
00151       }
00152       catch (IOException e)
00153       {
00154           throw new RuntimeFault(e, e);
00155       }
00156   }

String edu.virtualschool.jco.unfinished.JCODHPrivateKey.getFormat  ) 
 

Returns the name of the primary encoding format of this key, or null if this key does not support encoding. The primary encoding format is named in terms of the appropriate ASN.1 data format, if an ASN.1 specification for this key exists. For example, the name of the ASN.1 data format for public keys is SubjectPublicKeyInfo, as defined by the X.509 standard; in this case, the returned format is "X.509". Similarly, the name of the ASN.1 data format for private keys is PrivateKeyInfo, as defined by the PKCS #8 standard; in this case, the returned format is "PKCS#8".

Returns:
the primary encoding format of the key.

Implements edu.virtualschool.jco.JCOKey.

Definition at line 135 of file JCODHPrivateKey.java.

00136   {
00137       return "PKCS#8";
00138   }


The documentation for this class was generated from the following file: