Secure iNet Factory

com.jscape.inet.ssh.transport.keyformat
Class RSAKeyFormat

java.lang.Object
  extended by com.jscape.inet.ssh.transport.keyformat.KeyFormat
      extended by com.jscape.inet.ssh.transport.keyformat.RSAKeyFormat

public class RSAKeyFormat
extends KeyFormat

Version:
1.0
Author:
Alex Usun

Field Summary
static java.lang.String ALGORITHM
          Field ALGORITHM
static java.lang.String JAVA_ALGORITHM
          Field JAVA_ALGORITHM
 
Constructor Summary
RSAKeyFormat()
           
 
Method Summary
 byte[] format(java.security.PublicKey key)
           
 java.security.KeyPair generateKeyPair()
           
 java.security.PublicKey getKeyFrom(byte[] data)
           
 byte[] getSignatureFrom(byte[] data)
           
 byte[] sign(byte[] data, java.security.PrivateKey key)
           
 void verifySignature(byte[] sign, byte[] data, java.security.PublicKey key)
           
 
Methods inherited from class com.jscape.inet.ssh.transport.keyformat.KeyFormat
getAlgorithm
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALGORITHM

public static final java.lang.String ALGORITHM
Field ALGORITHM

See Also:
Constant Field Values

JAVA_ALGORITHM

public static final java.lang.String JAVA_ALGORITHM
Field JAVA_ALGORITHM

See Also:
Constant Field Values
Constructor Detail

RSAKeyFormat

public RSAKeyFormat()
Method Detail

getKeyFrom

public java.security.PublicKey getKeyFrom(byte[] data)
                                   throws KeyFormatException
Specified by:
getKeyFrom in class KeyFormat
Parameters:
data -
Returns:
public key
Throws:
KeyFormatException

format

public byte[] format(java.security.PublicKey key)
              throws KeyFormatException
Specified by:
format in class KeyFormat
Parameters:
key -
Returns:
byte array order
Throws:
KeyFormatException

getSignatureFrom

public byte[] getSignatureFrom(byte[] data)
                        throws KeyFormatException
Specified by:
getSignatureFrom in class KeyFormat
Parameters:
data -
Returns:
byte array order
Throws:
KeyFormatException

sign

public byte[] sign(byte[] data,
                   java.security.PrivateKey key)
            throws KeyFormatException
Specified by:
sign in class KeyFormat
Parameters:
data -
key -
Returns:
byte array order
Throws:
KeyFormatException

verifySignature

public void verifySignature(byte[] sign,
                            byte[] data,
                            java.security.PublicKey key)
                     throws KeyFormatException
Specified by:
verifySignature in class KeyFormat
Parameters:
sign -
data -
key -
Throws:
KeyFormatException

generateKeyPair

public java.security.KeyPair generateKeyPair()
                                      throws KeyFormatException
Specified by:
generateKeyPair in class KeyFormat
Returns:
key pair
Throws:
KeyFormatException

Secure iNet Factory

Copyright © JSCAPE LLC. 1999-2011. All Rights Reserved