|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--wtanaka.praya.gale.GalePublicKey
Represents a public key.
Return to
or the Praya Homepage
| Field Summary | |
static int |
DA_MD2
|
static int |
DA_MD5
|
static byte[] |
DIGEST_INFO_A
|
static int |
DIGEST_INFO_A_LEN
|
static byte[] |
DIGEST_INFO_B
|
static int |
DIGEST_INFO_B_LEN
|
static int |
DIGEST_INFO_LEN
|
(package private) int |
m_bits
|
(package private) Timestamp |
m_expireDate
|
(package private) FragmentList |
m_fragments
|
(package private) java.lang.String |
m_id
|
(package private) int |
m_originalStreamVersion
|
(package private) java.lang.String |
m_owner
|
(package private) java.math.BigInteger |
m_rsaExponent
|
(package private) java.math.BigInteger |
m_rsaModulus
|
(package private) byte[] |
m_signature
|
(package private) Timestamp |
m_signedDate
|
static int |
MAX_DIGEST_LEN
|
static int |
MAX_RSA_MODULUS_BITS
|
static int |
MAX_RSA_MODULUS_LEN
|
static int |
MAX_RSA_PRIME_BITS
|
static int |
MAX_RSA_PRIME_LEN
|
static int |
MAX_SIGNATURE_LEN
|
static int |
MIN_RSA_MODULUS_BITS
|
private static long |
RSA_F4
|
| Fields inherited from interface java.security.PublicKey |
serialVersionUID |
| Constructor Summary | |
|
GalePublicKey(java.io.File f)
Convenience Constructor which reads in from a file |
|
GalePublicKey(GaleInputStream in)
Constructor which reads in from a file |
(package private) |
GalePublicKey(java.lang.String id)
package visible constructor which constructs a key suitable for stub export. |
|
GalePublicKey(java.lang.String owner,
java.lang.String id,
int bits,
java.math.BigInteger rsaModulus,
java.math.BigInteger rsaExponent)
Constructor for a newly generated key. |
| Method Summary | |
private static byte[] |
encodeDigestInfo(byte[] digest,
int digestAlgorithm)
|
void |
exportStub(GaleOutputStream gout,
int version)
exports EXPORT_STUB format, for the given version Stub lengths: * Version 2: 4 // magic + 4 // id length + m_id.length()*2 // id length Locks the output stream with synchronized (gout) |
java.lang.String |
getAlgorithm()
|
java.lang.String |
getBackwardID()
Gets the ID of this key in reversed order (most specific key part first). |
int |
getBits()
|
byte[] |
getEncoded()
|
java.lang.String |
getFormat()
|
FragmentList |
getFragmentList()
|
java.lang.String |
getID()
Deprecated. use getBackwardID instead |
java.lang.String |
getKeyMember()
If the key.member field exists, this method returns the content of that fragment. |
Location |
getLocation()
|
java.math.BigInteger |
getModulus()
|
java.lang.String |
getOwner()
Gets the owner of this key ("comment" in v1 format, "comment" in v2 format, "key.owner" in v3 format) |
java.math.BigInteger |
getPublicExponent()
|
Location |
getRedirectTarget()
If the key.redirect field exists, this method returns the merged location that this key points at. |
int |
getStreamLength()
Convenience method which gets the stream length for this public key using the stream version this was originally constructed with. |
int |
getStreamLength(int version)
|
private byte[] |
publicBlock(byte[] input)
|
java.math.BigInteger |
publicDecrypt(byte[] input)
public decrypt |
(package private) byte[] |
publicEncrypt(byte[] input)
|
GalePublicKey |
sign(GalePrivateKey priv)
|
java.lang.String |
toString()
|
void |
verify(byte[] signature,
byte[] message)
Verify that the given message, when signed with the private key corresponding to this key, produces the given signature. |
void |
write(GaleOutputStream gout)
Convenience method which writes this public key to the given stream using the stream version this was originally constructed with. |
void |
write(GaleOutputStream gout,
int version)
Writes the public key to the stream with the given stream version. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static final int DA_MD2
public static final int DA_MD5
private static final long RSA_F4
public static final int MIN_RSA_MODULUS_BITS
public static final int MAX_RSA_MODULUS_BITS
public static final int MAX_RSA_MODULUS_LEN
public static final int MAX_RSA_PRIME_BITS
public static final int MAX_RSA_PRIME_LEN
public static final int MAX_DIGEST_LEN
public static final byte[] DIGEST_INFO_A
public static final int DIGEST_INFO_A_LEN
public static byte[] DIGEST_INFO_B
public static final int DIGEST_INFO_B_LEN
public static final int DIGEST_INFO_LEN
public static final int MAX_SIGNATURE_LEN
java.lang.String m_id
int m_bits
java.lang.String m_owner
java.math.BigInteger m_rsaExponent
java.math.BigInteger m_rsaModulus
Timestamp m_signedDate
Timestamp m_expireDate
FragmentList m_fragments
byte[] m_signature
int m_originalStreamVersion
| Constructor Detail |
public GalePublicKey(java.io.File f)
throws java.io.IOException
public GalePublicKey(GaleInputStream in)
throws java.io.IOException
GalePublicKey(java.lang.String id)
public GalePublicKey(java.lang.String owner,
java.lang.String id,
int bits,
java.math.BigInteger rsaModulus,
java.math.BigInteger rsaExponent)
| Method Detail |
public GalePublicKey sign(GalePrivateKey priv)
throws java.security.NoSuchAlgorithmException
public java.lang.String getID()
public java.lang.String getBackwardID()
public void exportStub(GaleOutputStream gout,
int version)
throws java.io.IOException
gout - the output stream on which to export the stub key.version - should be "2"java.lang.IllegalArgumentException - if version != 2public int getStreamLength(int version)
public void write(GaleOutputStream gout,
int version)
throws java.io.IOException,
NotEnoughInfoException
gout - the output stream to write toversion - the key file format version to use when writing
this keyNotEnoughInfoException - if this is a stub key. Use
exportStub instead.java.io.IOException - if any write to the stream throws
IOExceptionpublic int getStreamLength()
public void write(GaleOutputStream gout)
throws java.io.IOException,
NotEnoughInfoException
gout - the output stream to write toNotEnoughInfoException - if this is a stub key. Use
exportStub instead.java.io.IOException - if any write to the stream throws
IOExceptionpublic java.lang.String getAlgorithm()
getAlgorithm in interface java.security.Keypublic java.lang.String getFormat()
getFormat in interface java.security.Keypublic byte[] getEncoded()
getEncoded in interface java.security.Key
public void verify(byte[] signature,
byte[] message)
throws AuthException,
InvalidKeyFormatException
GalePrivateKey.sign(byte[])
private static byte[] encodeDigestInfo(byte[] digest,
int digestAlgorithm)
private byte[] publicBlock(byte[] input)
byte[] publicEncrypt(byte[] input)
throws InvalidKeyFormatException
public java.math.BigInteger publicDecrypt(byte[] input)
throws InvalidKeyFormatException,
AuthException
public FragmentList getFragmentList()
public int getBits()
public Location getRedirectTarget()
public Location getLocation()
public java.lang.String getKeyMember()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.math.BigInteger getModulus()
public java.math.BigInteger getPublicExponent()
public java.lang.String getOwner()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||