uc3m.it.ptm.authentication
Class PKCVerifier

java.lang.Object
  extended byuc3m.it.ptm.authentication.PKCVerifier
All Implemented Interfaces:
IPKCVerifier

public class PKCVerifier
extends java.lang.Object
implements IPKCVerifier


Field Summary
 
Fields inherited from interface uc3m.it.ptm.authentication.IPKCVerifier
CERT_NOT_FOUND, FILE_NOT_OPENED, PARAMETER_NOT_VALID, READING_CERT, STORE_NOT_VALID, TRUST_NOT_FOUND
 
Constructor Summary
PKCVerifier()
          This constructor creates a PKCVerifier.
 
Method Summary
 int getErrorCode()
          This method returns the error code.
 java.util.Hashtable getPKC(byte typeInfo, byte[] info)
          This method returns certificates matching search parameters.
 java.util.Vector getPKC(byte typeInfo, java.lang.String hashAlgorithmId, byte[] info)
          This method returns certificates matching search parameters.
 float getTrustValue(byte typeInfo, java.lang.String hashAlgorithmId, byte[] info)
          This method returns the trust value associatted to a user.
 java.lang.String[] getValidityPeriod()
          This method returns the validity period of the certificate.
 int isPKCValid(byte typeInfo, java.lang.String hashAlgorithmId, byte[] info)
          This method validates a certificate matching search parameters.
 boolean isPKCValid(CertBean cb)
          This method validates a certificate from a certificate bean.
 int isPKCValid(java.lang.String path)
          This method validates a certificate from a specific path.
 int isTrusted(byte typeInfo, java.lang.String hashAlgorithmId, byte[] info, float trustThreshold)
          This method evaluates the user's trustworthiness from a trust threshold.
 boolean isTrusted(CertBean cb, float trustThreshold)
          This method evaluates the user's trustworthiness from a trust threshold.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PKCVerifier

public PKCVerifier()
This constructor creates a PKCVerifier.

Method Detail

getPKC

public java.util.Vector getPKC(byte typeInfo,
                               java.lang.String hashAlgorithmId,
                               byte[] info)
This method returns certificates matching search parameters. This returns a certificate vector coded in DER format.

Parameters:
typeInfo - byte (search information: (0 = SubjectPKC, 1 = BaseCertID, 2 = Hash Public Key Certificate)
hashAlgorithmId - String (OID hash algorithm ("sha1" or "md5"). If not, it is null)
info - byte[] (byte array corresponds the encoding information)

getPKC

public java.util.Hashtable getPKC(byte typeInfo,
                                  byte[] info)
This method returns certificates matching search parameters. This returns a hashtable that contains two vectors: - certificate vector = certificates coded in DER format. - certificate path vector = absolute certificate paths.

Parameters:
typeInfo - byte (search information: (0 = SubjectPKC, 1 = BaseCertID, 2 = Hash Public Key)
info - byte[] (byte array corresponds the encoding information)

isPKCValid

public int isPKCValid(byte typeInfo,
                      java.lang.String hashAlgorithmId,
                      byte[] info)
This method validates a certificate matching search parameters.

Specified by:
isPKCValid in interface IPKCVerifier
Returns:
0: not valid

isPKCValid

public int isPKCValid(java.lang.String path)
This method validates a certificate from a specific path.


isPKCValid

public boolean isPKCValid(CertBean cb)
This method validates a certificate from a certificate bean.

Specified by:
isPKCValid in interface IPKCVerifier

isTrusted

public int isTrusted(byte typeInfo,
                     java.lang.String hashAlgorithmId,
                     byte[] info,
                     float trustThreshold)
This method evaluates the user's trustworthiness from a trust threshold.

Specified by:
isTrusted in interface IPKCVerifier

isTrusted

public boolean isTrusted(CertBean cb,
                         float trustThreshold)
This method evaluates the user's trustworthiness from a trust threshold.

Specified by:
isTrusted in interface IPKCVerifier

getTrustValue

public float getTrustValue(byte typeInfo,
                           java.lang.String hashAlgorithmId,
                           byte[] info)
This method returns the trust value associatted to a user.

Specified by:
getTrustValue in interface IPKCVerifier

getValidityPeriod

public java.lang.String[] getValidityPeriod()
This method returns the validity period of the certificate.

Specified by:
getValidityPeriod in interface IPKCVerifier

getErrorCode

public int getErrorCode()
This method returns the error code.

Specified by:
getErrorCode in interface IPKCVerifier

main

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