X509CertBridge.java [plain text]
package javax.security.cert;
import java.math.BigInteger;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.Principal;
import java.security.PublicKey;
import java.security.SignatureException;
import java.util.Date;
final class X509CertBridge extends X509Certificate
{
private java.security.cert.X509Certificate cert;
X509CertBridge(java.security.cert.X509Certificate cert)
{
this.cert = cert;
}
public byte[] getEncoded() throws CertificateEncodingException
{
try
{
return cert.getEncoded();
}
catch (java.security.cert.CertificateEncodingException cee)
{
throw new CertificateEncodingException(cee.getMessage());
}
}
public void verify(PublicKey key)
throws CertificateException, NoSuchAlgorithmException, InvalidKeyException,
NoSuchProviderException, SignatureException
{
try
{
cert.verify(key);
}
catch (java.security.cert.CertificateException ce)
{
throw new CertificateException(ce.getMessage());
}
}
public void verify(PublicKey key, String sigProvider)
throws CertificateException, NoSuchAlgorithmException, InvalidKeyException,
NoSuchProviderException, SignatureException
{
try
{
cert.verify(key, sigProvider);
}
catch (java.security.cert.CertificateException ce)
{
throw new CertificateException(ce.getMessage());
}
}
public String toString()
{
return cert.toString();
}
public PublicKey getPublicKey()
{
return cert.getPublicKey();
}
public void checkValidity()
throws CertificateExpiredException, CertificateNotYetValidException
{
try
{
cert.checkValidity();
}
catch (java.security.cert.CertificateExpiredException cee)
{
throw new CertificateExpiredException(cee.getMessage());
}
catch (java.security.cert.CertificateNotYetValidException cnyve)
{
throw new CertificateNotYetValidException(cnyve.getMessage());
}
}
public void checkValidity(Date date)
throws CertificateExpiredException, CertificateNotYetValidException
{
try
{
cert.checkValidity(date);
}
catch (java.security.cert.CertificateExpiredException cee)
{
throw new CertificateExpiredException(cee.getMessage());
}
catch (java.security.cert.CertificateNotYetValidException cnyve)
{
throw new CertificateNotYetValidException(cnyve.getMessage());
}
}
public int getVersion()
{
return cert.getVersion();
}
public BigInteger getSerialNumber()
{
return cert.getSerialNumber();
}
public Principal getIssuerDN()
{
return cert.getIssuerDN();
}
public Principal getSubjectDN()
{
return cert.getSubjectDN();
}
public Date getNotBefore()
{
return cert.getNotBefore();
}
public Date getNotAfter()
{
return cert.getNotAfter();
}
public String getSigAlgName()
{
return cert.getSigAlgName();
}
public String getSigAlgOID()
{
return cert.getSigAlgOID();
}
public byte[] getSigAlgParams()
{
return cert.getSigAlgParams();
}
}