public class Validator
extends java.lang.Object
This class contains utility methods for validating the property values of a service against a DSA signature.
| Modifier and Type | Field and Description | 
|---|---|
| static java.lang.String | CLASS_VERSIONClass version string | 
| Constructor and Description | 
|---|
| Validator() | 
| Modifier and Type | Method and Description | 
|---|---|
| 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. | 
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)