Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.traxel.crypto
Class DHUtil  view DHUtil download DHUtil.java

java.lang.Object
  extended bycom.traxel.crypto.DHUtil

public class DHUtil
extends java.lang.Object

This class has been coded to solve my specific problems. It is not general purpose. Use at your own risk.


Field Summary
static java.lang.String DH
           
 
Constructor Summary
DHUtil()
           
 
Method Summary
static javax.crypto.spec.DHParameterSpec generateDhParams(int bitSize)
           
static boolean isBase16(char character)
           
static void main(java.lang.String[] args)
           
static java.security.spec.PKCS8EncodedKeySpec pkcs8FromBase16(java.io.InputStream in)
           
static javax.crypto.interfaces.DHPrivateKey privKeyFromBase16(java.io.InputStream in)
          WARNING: This is quite happy to extract the base 16 bytes from a non-base 16 document.
static javax.crypto.interfaces.DHPrivateKey privKeyFromPkcs8(java.security.spec.PKCS8EncodedKeySpec pkcs8)
           
static javax.crypto.interfaces.DHPublicKey pubKeyFromBase16(java.io.InputStream in)
          WARNING: This is quite happy to extract the base 16 bytes from a non-base 16 document.
static javax.crypto.interfaces.DHPublicKey pubKeyFromX509(java.security.spec.X509EncodedKeySpec x509)
           
static java.lang.String readBase16(java.io.InputStream in)
           
static java.security.spec.X509EncodedKeySpec x509FromBase16(java.io.InputStream in)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DH

public static final java.lang.String DH
See Also:
Constant Field Values
Constructor Detail

DHUtil

public DHUtil()
Method Detail

generateDhParams

public static javax.crypto.spec.DHParameterSpec generateDhParams(int bitSize)

privKeyFromBase16

public static javax.crypto.interfaces.DHPrivateKey privKeyFromBase16(java.io.InputStream in)
                                                              throws java.security.spec.InvalidKeySpecException,
                                                                     java.io.IOException
WARNING: This is quite happy to extract the base 16 bytes from a non-base 16 document. EG: if you read from "document" it would return "dce".
NOTE: This method depends on the termination of the input stream (IE: it returns -1 in response to a read() ).


pubKeyFromBase16

public static javax.crypto.interfaces.DHPublicKey pubKeyFromBase16(java.io.InputStream in)
                                                            throws java.security.spec.InvalidKeySpecException,
                                                                   java.io.IOException
WARNING: This is quite happy to extract the base 16 bytes from a non-base 16 document. EG: if you read from "document" it would return "dce".
NOTE: This method depends on the termination of the input stream (IE: it returns -1 in response to a read() ).


pubKeyFromX509

public static javax.crypto.interfaces.DHPublicKey pubKeyFromX509(java.security.spec.X509EncodedKeySpec x509)
                                                          throws java.security.spec.InvalidKeySpecException

privKeyFromPkcs8

public static javax.crypto.interfaces.DHPrivateKey privKeyFromPkcs8(java.security.spec.PKCS8EncodedKeySpec pkcs8)
                                                             throws java.security.spec.InvalidKeySpecException

pkcs8FromBase16

public static java.security.spec.PKCS8EncodedKeySpec pkcs8FromBase16(java.io.InputStream in)
                                                              throws java.io.IOException

x509FromBase16

public static java.security.spec.X509EncodedKeySpec x509FromBase16(java.io.InputStream in)
                                                            throws java.io.IOException

readBase16

public static java.lang.String readBase16(java.io.InputStream in)
                                   throws java.io.IOException

isBase16

public static boolean isBase16(char character)

main

public static void main(java.lang.String[] args)