|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatg.nucleus.Validator
public class Validator
This class contains utility methods for validating the property values of a service against a DSA signature.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Constructor Summary | |
---|---|
Validator()
|
Method Summary | |
---|---|
static java.lang.String |
byteArrayToPropertyValue(byte[] pBytes)
Converts the specified byte array to a comma-separated list of values suitable for use in a property file. |
static java.lang.String |
calculateSignature(java.lang.Object pService,
java.lang.String[] pPropertyList,
java.security.PrivateKey pKey)
Calculates the signature determined by serializing the values of each of the named properties of the specified service, signing the resulting serialized byte array with the specified private key, then listing the resulting bytes as a comma-separated list suitable for use in a properties file. |
static java.security.PrivateKey |
deserializePrivateKey(java.lang.String pKey)
Deserializes a private key from the specified string, which contains the serialized form of the key represented as hexadecimal digits. |
static java.security.PublicKey |
deserializePublicKey(java.lang.String pKey)
Deserializes a public key from the specified string, which contains the serialized form of the key represented as hexadecimal digits. |
static void |
validateProperties(java.lang.Object pService,
java.lang.String[] pPropertyList,
byte[] pSignature,
java.security.PublicKey pKey,
java.lang.String pMessage)
This tests to see if the the currently serialized values of the given properties match the values signed by the given key's corresponding private key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public Validator()
Method Detail |
---|
public static void validateProperties(java.lang.Object pService, java.lang.String[] pPropertyList, byte[] pSignature, java.security.PublicKey pKey, java.lang.String pMessage) throws ValidationException
pService
- the object whose properties are to be examinedpPropertyList
- the list of property names to be examinedpSignature
- the signature obtained by signing the expected
property values with a private key.pKey
- the public key corresponding to the private key used
to generate the signature.pMessage
- a message to be attached to the
ValidationException if the property values do not match.
ValidationException
- if the property values do not
match the digest, or if some other error occurred while
attempting to verify the property values.public static java.lang.String calculateSignature(java.lang.Object pService, java.lang.String[] pPropertyList, java.security.PrivateKey pKey)
public static java.lang.String byteArrayToPropertyValue(byte[] pBytes)
public static java.security.PublicKey deserializePublicKey(java.lang.String pKey)
public static java.security.PrivateKey deserializePrivateKey(java.lang.String pKey)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |