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

edu.virtualschool.jco.unfinished.JCODHPublicKey Class Reference

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

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

Collaboration graph
[legend]
List of all members.

Detailed Description

The public half of a JCO Asymmetric key pair. The algorithm is RCA. The encoding format is X509.
Author:
bcox

Definition at line 34 of file JCODHPublicKey.java.

Public Member Functions

 JCODHPublicKey (String str) throws JCOFault
 JCODHPublicKey (byte[] bytes) throws JCOFault
byte[] encryptBytes (byte[] inputBytes) throws JCOFault
byte[] decryptBytes (byte[] inputBytes) throws JCOFault
final BigInteger getY ()
final String getAlgorithm ()
final String getFormat ()
byte[] getEncoded ()
JCOEncodedBytes encode ()
Object verify (JCOSignedBytes signedObject) throws JCOSignatureFault, JCOFault
final AsymmetricKeyParameter getParameters ()

Package Functions

 JCODHPublicKey (DHPublicKeyParameters key)


Member Function Documentation

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

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

Implements edu.virtualschool.jco.JCOKey.

Definition at line 280 of file JCODHPublicKey.java.

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

00281   {
00282     return new JCOEncodedBytes(getEncoded()); 
00283   }

final String edu.virtualschool.jco.unfinished.JCODHPublicKey.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 254 of file JCODHPublicKey.java.

00255   {
00256     return "DH"; 
00257   }

byte [] edu.virtualschool.jco.unfinished.JCODHPublicKey.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 262 of file JCODHPublicKey.java.

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

00263   {
00264       ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
00265       DEROutputStream         dOut = new DEROutputStream(bOut);
00266       DHParameter dhp = new DHParameter(params.getP(), params.getG(), 0);
00267       AlgorithmIdentifier aid = new AlgorithmIdentifier(X9ObjectIdentifiers.dhpublicnumber, dhp.getDERObject());
00268       SubjectPublicKeyInfo    info = new SubjectPublicKeyInfo(aid, new DERInteger(y));
00269       try
00270       {
00271         dOut.writeObject(info);
00272         dOut.close();
00273         return bOut.toByteArray();
00274       }
00275       catch (IOException e)
00276       {
00277           throw new RuntimeFault(e, e);
00278       }
00279   }

final String edu.virtualschool.jco.unfinished.JCODHPublicKey.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 258 of file JCODHPublicKey.java.

00259   {
00260     return "X.509";
00261   }


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