Java Doc for X509CertImpl.java in  » 6.0-JDK-Modules » j2me » sun » security » x509 » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » sun.security.x509 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.security.Certificate
   java.security.cert.X509Certificate
      sun.security.x509.X509CertImpl

X509CertImpl
public class X509CertImpl extends X509Certificate implements DerEncoder(Code)
The X509CertImpl class represents an X.509 certificate. These certificates are widely used to support authentication and other functionality in Internet security systems. Common applications include Privacy Enhanced Mail (PEM), Transport Layer Security (SSL), code signing for trusted software distribution, and Secure Electronic Transactions (SET). There is a commercial infrastructure ready to manage large scale deployments of X.509 identity certificates.

These certificates are managed and vouched for by Certificate Authorities (CAs). CAs are services which create certificates by placing data in the X.509 standard format and then digitally signing that data. Such signatures are quite difficult to forge. CAs act as trusted third parties, making introductions between agents who have no direct knowledge of each other. CA certificates are either signed by themselves, or by some other CA such as a "root" CA.

RFC 1422 is very informative, though it does not describe much of the recent work being done with X.509 certificates. That includes a 1996 version (X.509v3) and a variety of enhancements being made to facilitate an explosion of personal certificates used as "Internet Drivers' Licences", or with SET for credit card transactions.

More recent work includes the IETF PKIX Working Group efforts, especially RFC2459.
author:
   Dave Brownell
author:
   Amit Kapoor
author:
   Hemma Prafullchandra
version:
   1.109 02/02/00
See Also:   X509CertInfo



Field Summary
final public static  StringALG_ID
    
final public static  StringINFO
    
final public static  StringISSUER_DN
    
final public static  StringNAME
     Public attribute names.
final public static  StringPUBLIC_KEY
    
final public static  StringSERIAL_ID
    
final public static  StringSIG
    
final public static  StringSIGNATURE
    
final public static  StringSIGNED_CERT
    
final public static  StringSIG_ALG
    
final public static  StringSUBJECT_DN
     The following are defined for ease-of-use.
final public static  StringVERSION
    
protected  AlgorithmIdalgId
    
protected  X509CertInfoinfo
    
protected  byte[]signature
    

Constructor Summary
public  X509CertImpl()
     Default constructor.
public  X509CertImpl(byte[] certData)
     Unmarshals a certificate from its encoded form, parsing the encoded bytes.
public  X509CertImpl(InputStream in)
     unmarshals an X.509 certificate from an input stream.
public  X509CertImpl(X509CertInfo certInfo)
     Construct an initialized X509 Certificate.
public  X509CertImpl(DerValue derVal)
     Unmarshal a certificate from its encoded form, parsing a DER value.

Method Summary
public  voidcheckValidity()
     Checks that the certificate is currently valid, i.e.
public  voidcheckValidity(Date date)
     Checks that the specified date is within the certificate's validity period, or basically if the certificate would be valid at the specified date/time.
public  voiddelete(String name)
     Delete the requested attribute from the certificate.
public  voidderEncode(OutputStream out)
     DER encode this object onto an output stream.
public  voidencode(OutputStream out)
     Appends the certificate to an output stream.
public  Objectget(String name)
     Return the requested attribute from the certificate. Note that the X509CertInfo is not cloned for performance reasons. Callers must ensure that they do not modify it.
public  AuthorityKeyIdentifierExtensiongetAuthorityKeyIdentifierExtension()
    
public  intgetBasicConstraints()
     Get the certificate constraints path length from the the critical BasicConstraints extension, (oid = 2.5.29.19).
public  BasicConstraintsExtensiongetBasicConstraintsExtension()
    
public  SetgetCriticalExtensionOIDs()
     Gets a Set of the extension(s) marked CRITICAL in the certificate.
public  EnumerationgetElements()
     Return an enumeration of names of attributes existing within this attribute.
public  byte[]getEncoded()
     Returns the encoded form of this certificate.
public  byte[]getEncodedInternal()
     Returned the encoding as an uncloned byte array.
public static  byte[]getEncodedInternal(Certificate cert)
     Returned the encoding of the given certificate for internal use. Callers must guarantee that they neither modify it nor expose it to untrusted code.
public synchronized  ListgetExtendedKeyUsage()
     This method are the overridden implementation of getExtendedKeyUsage method in X509Certificate in the Sun provider.
public static  ListgetExtendedKeyUsage(X509Certificate cert)
     This static method is the default implementation of the getExtendedKeyUsage method in X509Certificate.
public  ExtendedKeyUsageExtensiongetExtendedKeyUsageExtension()
    
public  ExtensiongetExtension(ObjectIdentifier oid)
     Gets the extension identified by the given ObjectIdentifier
Parameters:
  oid - the Object Identifier value for the extension.
public  byte[]getExtensionValue(String oid)
     Gets the DER encoded extension identified by the given oid String.
public  IssuerAlternativeNameExtensiongetIssuerAlternativeNameExtension()
    
public synchronized  CollectiongetIssuerAlternativeNames()
     This method are the overridden implementation of getIssuerAlternativeNames method in X509Certificate in the Sun provider.
public static  CollectiongetIssuerAlternativeNames(X509Certificate cert)
     This static method is the default implementation of the getIssuerAlternaitveNames method in X509Certificate.
public  PrincipalgetIssuerDN()
     Gets the issuer distinguished name from the certificate.
public  boolean[]getIssuerUniqueID()
     Gets the Issuer Unique Identity from the certificate.
public  X500PrincipalgetIssuerX500Principal()
     Get issuer name as X500Principal.
public static  X500PrincipalgetIssuerX500Principal(X509Certificate cert)
     Extract the issuer X500Principal from an X509Certificate.
public  boolean[]getKeyUsage()
     Get a boolean array representing the bits of the KeyUsage extension, (oid = 2.5.29.15).
public  StringgetName()
     Return the name of this attribute.
public  NameConstraintsExtensiongetNameConstraintsExtension()
    
public  SetgetNonCriticalExtensionOIDs()
     Gets a Set of the extension(s) marked NON-CRITICAL in the certificate.
public  DategetNotAfter()
     Gets the notAfter date from the validity period of the certificate.
public  DategetNotBefore()
     Gets the notBefore date from the validity period of the certificate.
public  PolicyConstraintsExtensiongetPolicyConstraintsExtension()
    
public  PolicyMappingsExtensiongetPolicyMappingsExtension()
    
public  PrivateKeyUsageExtensiongetPrivateKeyUsageExtension()
    
public  PublicKeygetPublicKey()
     Gets the publickey from this certificate.
public  BigIntegergetSerialNumber()
     Gets the serial number from the certificate.
public  StringgetSigAlgName()
     Gets the signature algorithm name for the certificate signature algorithm.
public  StringgetSigAlgOID()
     Gets the signature algorithm OID string from the certificate.
public  byte[]getSigAlgParams()
     Gets the DER encoded signature algorithm parameters from this certificate's signature algorithm.
public  byte[]getSignature()
     Gets the raw Signature bits from the certificate.
public  SubjectAlternativeNameExtensiongetSubjectAlternativeNameExtension()
    
public synchronized  CollectiongetSubjectAlternativeNames()
     This method are the overridden implementation of getSubjectAlternativeNames method in X509Certificate in the Sun provider.
public static  CollectiongetSubjectAlternativeNames(X509Certificate cert)
     This static method is the default implementation of the getSubjectAlternaitveNames method in X509Certificate.
public  PrincipalgetSubjectDN()
     Gets the subject distinguished name from the certificate.
public  SubjectKeyIdentifierExtensiongetSubjectKeyIdentifierExtension()
    
public  boolean[]getSubjectUniqueID()
     Gets the Subject Unique Identity from the certificate.
public  X500PrincipalgetSubjectX500Principal()
     Get subject name as X500Principal.
public static  X500PrincipalgetSubjectX500Principal(X509Certificate cert)
     Extract the subject X500Principal from an X509Certificate.
public  byte[]getTBSCertificate()
     Gets the DER encoded certificate informations, the tbsCertificate from this certificate.
public  intgetVersion()
     Gets the version number from the certificate. the version number, i.e.
public  booleanhasUnsupportedCriticalExtension()
     Return true if a critical extension is found that is not supported, otherwise return false.
public  voidset(String name, Object obj)
     Set the requested attribute in the certificate.
public  voidsign(PrivateKey key, String algorithm)
     Creates an X.509 certificate, and signs it using the given key (associating a signature algorithm and an X.500 name).
public  voidsign(PrivateKey key, String algorithm, String provider)
     Creates an X.509 certificate, and signs it using the given key (associating a signature algorithm and an X.500 name).
public static  X509CertImpltoImpl(X509Certificate cert)
     Utility method to convert an arbitrary instance of X509Certificate to a X509CertImpl.
public  StringtoString()
     Returns a printable representation of the certificate.
public  voidverify(PublicKey key)
     Throws an exception if the certificate was not signed using the verification key provided.
public synchronized  voidverify(PublicKey key, String sigProvider)
     Throws an exception if the certificate was not signed using the verification key provided.

Field Detail
ALG_ID
final public static String ALG_ID(Code)



INFO
final public static String INFO(Code)



ISSUER_DN
final public static String ISSUER_DN(Code)



NAME
final public static String NAME(Code)
Public attribute names.



PUBLIC_KEY
final public static String PUBLIC_KEY(Code)



SERIAL_ID
final public static String SERIAL_ID(Code)



SIG
final public static String SIG(Code)



SIGNATURE
final public static String SIGNATURE(Code)



SIGNED_CERT
final public static String SIGNED_CERT(Code)



SIG_ALG
final public static String SIG_ALG(Code)



SUBJECT_DN
final public static String SUBJECT_DN(Code)
The following are defined for ease-of-use. These are the most frequently retrieved attributes.



VERSION
final public static String VERSION(Code)



algId
protected AlgorithmId algId(Code)



info
protected X509CertInfo info(Code)



signature
protected byte[] signature(Code)




Constructor Detail
X509CertImpl
public X509CertImpl()(Code)
Default constructor.



X509CertImpl
public X509CertImpl(byte[] certData) throws CertificateException(Code)
Unmarshals a certificate from its encoded form, parsing the encoded bytes. This form of constructor is used by agents which need to examine and use certificate contents. That is, this is one of the more commonly used constructors. Note that the buffer must include only a certificate, and no "garbage" may be left at the end. If you need to ignore data at the end of a certificate, use another constructor.
Parameters:
  certData - the encoded bytes, with no trailing padding.
exception:
  CertificateException - on parsing and initialization errors.



X509CertImpl
public X509CertImpl(InputStream in) throws CertificateException(Code)
unmarshals an X.509 certificate from an input stream. If the certificate is RFC1421 hex-encoded, then it must begin with the line X509Factory.BEGIN_CERT and end with the line X509Factory.END_CERT.
Parameters:
  in - an input stream holding at least one certificate that maybe either DER-encoded or RFC1421 hex-encoded version of theDER-encoded certificate.
exception:
  CertificateException - on parsing and initialization errors.



X509CertImpl
public X509CertImpl(X509CertInfo certInfo)(Code)
Construct an initialized X509 Certificate. The certificate is stored in raw form and has to be signed to be useful.



X509CertImpl
public X509CertImpl(DerValue derVal) throws CertificateException(Code)
Unmarshal a certificate from its encoded form, parsing a DER value. This form of constructor is used by agents which need to examine and use certificate contents.
Parameters:
  derVal - the der value containing the encoded cert.
exception:
  CertificateException - on parsing and initialization errors.




Method Detail
checkValidity
public void checkValidity() throws CertificateExpiredException, CertificateNotYetValidException(Code)
Checks that the certificate is currently valid, i.e. the current time is within the specified validity period.
exception:
  CertificateExpiredException - if the certificate has expired.
exception:
  CertificateNotYetValidException - if the certificate is notyet valid.



checkValidity
public void checkValidity(Date date) throws CertificateExpiredException, CertificateNotYetValidException(Code)
Checks that the specified date is within the certificate's validity period, or basically if the certificate would be valid at the specified date/time.
Parameters:
  date - the Date to check against to see if this certificateis valid at that date/time.
exception:
  CertificateExpiredException - if the certificate has expiredwith respect to the date supplied.
exception:
  CertificateNotYetValidException - if the certificate is notyet valid with respect to the date supplied.



delete
public void delete(String name) throws CertificateException, IOException(Code)
Delete the requested attribute from the certificate.
Parameters:
  name - the name of the attribute.
exception:
  CertificateException - on invalid attribute identifier.
exception:
  IOException - on other errors.



derEncode
public void derEncode(OutputStream out) throws IOException(Code)
DER encode this object onto an output stream. Implements the DerEncoder interface.
Parameters:
  out - the output stream on which to write the DER encoding.
exception:
  IOException - on encoding error.



encode
public void encode(OutputStream out) throws CertificateEncodingException(Code)
Appends the certificate to an output stream.
Parameters:
  out - an input stream to which the certificate is appended.
exception:
  CertificateEncodingException - on encoding errors.



get
public Object get(String name) throws CertificateParsingException(Code)
Return the requested attribute from the certificate. Note that the X509CertInfo is not cloned for performance reasons. Callers must ensure that they do not modify it. All other attributes are cloned.
Parameters:
  name - the name of the attribute.
exception:
  CertificateParsingException - on invalid attribute identifier.



getAuthorityKeyIdentifierExtension
public AuthorityKeyIdentifierExtension getAuthorityKeyIdentifierExtension()(Code)
Get AuthorityKeyIdentifier extension AuthorityKeyIdentifier object or null (if no such object in certificate)



getBasicConstraints
public int getBasicConstraints()(Code)
Get the certificate constraints path length from the the critical BasicConstraints extension, (oid = 2.5.29.19). the length of the constraint.



getBasicConstraintsExtension
public BasicConstraintsExtension getBasicConstraintsExtension()(Code)
Get BasicConstraints extension BasicConstraints object or null (if no such object in certificate)



getCriticalExtensionOIDs
public Set getCriticalExtensionOIDs()(Code)
Gets a Set of the extension(s) marked CRITICAL in the certificate. In the returned set, each extension is represented by its OID string. a set of the extension oid strings in thecertificate that are marked critical.



getElements
public Enumeration getElements()(Code)
Return an enumeration of names of attributes existing within this attribute.



getEncoded
public byte[] getEncoded() throws CertificateEncodingException(Code)
Returns the encoded form of this certificate. It is assumed that each certificate type would have only a single form of encoding; for example, X.509 certificates would be encoded as ASN.1 DER.
exception:
  CertificateEncodingException - if an encoding error occurs.



getEncodedInternal
public byte[] getEncodedInternal() throws CertificateEncodingException(Code)
Returned the encoding as an uncloned byte array. Callers must guarantee that they neither modify it nor expose it to untrusted code.



getEncodedInternal
public static byte[] getEncodedInternal(Certificate cert) throws CertificateEncodingException(Code)
Returned the encoding of the given certificate for internal use. Callers must guarantee that they neither modify it nor expose it to untrusted code. Uses getEncodedInternal() if the certificate is instance of X509CertImpl, getEncoded() otherwise.



getExtendedKeyUsage
public synchronized List getExtendedKeyUsage() throws CertificateParsingException(Code)
This method are the overridden implementation of getExtendedKeyUsage method in X509Certificate in the Sun provider. It is better performance-wise since it returns cached values.



getExtendedKeyUsage
public static List getExtendedKeyUsage(X509Certificate cert) throws CertificateParsingException(Code)
This static method is the default implementation of the getExtendedKeyUsage method in X509Certificate. A X509Certificate provider generally should overwrite this to provide among other things caching for better performance.



getExtendedKeyUsageExtension
public ExtendedKeyUsageExtension getExtendedKeyUsageExtension()(Code)
Get ExtendedKeyUsage extension ExtendedKeyUsage extension object or null (if no such object in certificate)



getExtension
public Extension getExtension(ObjectIdentifier oid)(Code)
Gets the extension identified by the given ObjectIdentifier
Parameters:
  oid - the Object Identifier value for the extension. Extension or null if certificate does not contain thisextension



getExtensionValue
public byte[] getExtensionValue(String oid)(Code)
Gets the DER encoded extension identified by the given oid String.
Parameters:
  oid - the Object Identifier value for the extension.



getIssuerAlternativeNameExtension
public IssuerAlternativeNameExtension getIssuerAlternativeNameExtension()(Code)
Get IssuerAlternativeName extension IssuerAlternativeName object or null (if no such object in certificate)



getIssuerAlternativeNames
public synchronized Collection getIssuerAlternativeNames() throws CertificateParsingException(Code)
This method are the overridden implementation of getIssuerAlternativeNames method in X509Certificate in the Sun provider. It is better performance-wise since it returns cached values.



getIssuerAlternativeNames
public static Collection getIssuerAlternativeNames(X509Certificate cert) throws CertificateParsingException(Code)
This static method is the default implementation of the getIssuerAlternaitveNames method in X509Certificate. A X509Certificate provider generally should overwrite this to provide among other things caching for better performance.



getIssuerDN
public Principal getIssuerDN()(Code)
Gets the issuer distinguished name from the certificate. the issuer name.



getIssuerUniqueID
public boolean[] getIssuerUniqueID()(Code)
Gets the Issuer Unique Identity from the certificate. the Issuer Unique Identity.



getIssuerX500Principal
public X500Principal getIssuerX500Principal()(Code)
Get issuer name as X500Principal. Overrides implementation in X509Certificate with a slightly more efficient version that is also aware of X509CertImpl mutability.



getIssuerX500Principal
public static X500Principal getIssuerX500Principal(X509Certificate cert)(Code)
Extract the issuer X500Principal from an X509Certificate. Called from java.security.cert.X509Certificate.getIssuerX500Principal().



getKeyUsage
public boolean[] getKeyUsage()(Code)
Get a boolean array representing the bits of the KeyUsage extension, (oid = 2.5.29.15). the bit values of this extension as an array of booleans.



getName
public String getName()(Code)
Return the name of this attribute.



getNameConstraintsExtension
public NameConstraintsExtension getNameConstraintsExtension()(Code)
Get NameConstraints extension NameConstraints object or null (if no such object in certificate)



getNonCriticalExtensionOIDs
public Set getNonCriticalExtensionOIDs()(Code)
Gets a Set of the extension(s) marked NON-CRITICAL in the certificate. In the returned set, each extension is represented by its OID string. a set of the extension oid strings in thecertificate that are NOT marked critical.



getNotAfter
public Date getNotAfter()(Code)
Gets the notAfter date from the validity period of the certificate. the end date of the validity period.



getNotBefore
public Date getNotBefore()(Code)
Gets the notBefore date from the validity period of the certificate. the start date of the validity period.



getPolicyConstraintsExtension
public PolicyConstraintsExtension getPolicyConstraintsExtension()(Code)
Get PolicyConstraints extension PolicyConstraints object or null (if no such object in certificate)



getPolicyMappingsExtension
public PolicyMappingsExtension getPolicyMappingsExtension()(Code)
Get PolicyMappingsExtension extension PolicyMappingsExtension object or null (if no such object in certificate)



getPrivateKeyUsageExtension
public PrivateKeyUsageExtension getPrivateKeyUsageExtension()(Code)
Get PrivateKeyUsage extension PrivateKeyUsage object or null (if no such object in certificate)



getPublicKey
public PublicKey getPublicKey()(Code)
Gets the publickey from this certificate. the publickey.



getSerialNumber
public BigInteger getSerialNumber()(Code)
Gets the serial number from the certificate. the serial number.



getSigAlgName
public String getSigAlgName()(Code)
Gets the signature algorithm name for the certificate signature algorithm. For example, the string "SHA-1/DSA" or "DSS". the signature algorithm name.



getSigAlgOID
public String getSigAlgOID()(Code)
Gets the signature algorithm OID string from the certificate. For example, the string "1.2.840.10040.4.3" the signature algorithm oid string.



getSigAlgParams
public byte[] getSigAlgParams()(Code)
Gets the DER encoded signature algorithm parameters from this certificate's signature algorithm. the DER encoded signature algorithm parameters, ornull if no parameters are present.



getSignature
public byte[] getSignature()(Code)
Gets the raw Signature bits from the certificate. the signature.



getSubjectAlternativeNameExtension
public SubjectAlternativeNameExtension getSubjectAlternativeNameExtension()(Code)
Get SubjectAlternativeName extension SubjectAlternativeName object or null (if no such object in certificate)



getSubjectAlternativeNames
public synchronized Collection getSubjectAlternativeNames() throws CertificateParsingException(Code)
This method are the overridden implementation of getSubjectAlternativeNames method in X509Certificate in the Sun provider. It is better performance-wise since it returns cached values.



getSubjectAlternativeNames
public static Collection getSubjectAlternativeNames(X509Certificate cert) throws CertificateParsingException(Code)
This static method is the default implementation of the getSubjectAlternaitveNames method in X509Certificate. A X509Certificate provider generally should overwrite this to provide among other things caching for better performance.



getSubjectDN
public Principal getSubjectDN()(Code)
Gets the subject distinguished name from the certificate. the subject name.



getSubjectKeyIdentifierExtension
public SubjectKeyIdentifierExtension getSubjectKeyIdentifierExtension()(Code)
Get SubjectKeyIdentifier extension SubjectKeyIdentifier object or null (if no such object in certificate)



getSubjectUniqueID
public boolean[] getSubjectUniqueID()(Code)
Gets the Subject Unique Identity from the certificate. the Subject Unique Identity.



getSubjectX500Principal
public X500Principal getSubjectX500Principal()(Code)
Get subject name as X500Principal. Overrides implementation in X509Certificate with a slightly more efficient version that is also aware of X509CertImpl mutability.



getSubjectX500Principal
public static X500Principal getSubjectX500Principal(X509Certificate cert)(Code)
Extract the subject X500Principal from an X509Certificate. Called from java.security.cert.X509Certificate.getSubjectX500Principal().



getTBSCertificate
public byte[] getTBSCertificate() throws CertificateEncodingException(Code)
Gets the DER encoded certificate informations, the tbsCertificate from this certificate. This can be used to verify the signature independently. the DER encoded certificate information.
exception:
  CertificateEncodingException - if an encoding error occurs.



getVersion
public int getVersion()(Code)
Gets the version number from the certificate. the version number, i.e. 1, 2 or 3.



hasUnsupportedCriticalExtension
public boolean hasUnsupportedCriticalExtension()(Code)
Return true if a critical extension is found that is not supported, otherwise return false.



set
public void set(String name, Object obj) throws CertificateException, IOException(Code)
Set the requested attribute in the certificate.
Parameters:
  name - the name of the attribute.
Parameters:
  obj - the value of the attribute.
exception:
  CertificateException - on invalid attribute identifier.
exception:
  IOException - on encoding error of attribute.



sign
public void sign(PrivateKey key, String algorithm) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException(Code)
Creates an X.509 certificate, and signs it using the given key (associating a signature algorithm and an X.500 name). This operation is used to implement the certificate generation functionality of a certificate authority.
Parameters:
  key - the private key used for signing.
Parameters:
  algorithm - the name of the signature algorithm used.
exception:
  InvalidKeyException - on incorrect key.
exception:
  NoSuchAlgorithmException - on unsupported signaturealgorithms.
exception:
  NoSuchProviderException - if there's no default provider.
exception:
  SignatureException - on signature errors.
exception:
  CertificateException - on encoding errors.



sign
public void sign(PrivateKey key, String algorithm, String provider) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException(Code)
Creates an X.509 certificate, and signs it using the given key (associating a signature algorithm and an X.500 name). This operation is used to implement the certificate generation functionality of a certificate authority.
Parameters:
  key - the private key used for signing.
Parameters:
  algorithm - the name of the signature algorithm used.
Parameters:
  provider - the name of the provider.
exception:
  NoSuchAlgorithmException - on unsupported signaturealgorithms.
exception:
  InvalidKeyException - on incorrect key.
exception:
  NoSuchProviderException - on incorrect provider.
exception:
  SignatureException - on signature errors.
exception:
  CertificateException - on encoding errors.



toImpl
public static X509CertImpl toImpl(X509Certificate cert) throws CertificateException(Code)
Utility method to convert an arbitrary instance of X509Certificate to a X509CertImpl. Does a cast if possible, otherwise reparses the encoding.



toString
public String toString()(Code)
Returns a printable representation of the certificate. This does not contain all the information available to distinguish this from any other certificate. The certificate must be fully constructed before this function may be called.



verify
public void verify(PublicKey key) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException(Code)
Throws an exception if the certificate was not signed using the verification key provided. Successfully verifying a certificate does not indicate that one should trust the entity which it represents.
Parameters:
  key - the public key used for verification.
exception:
  InvalidKeyException - on incorrect key.
exception:
  NoSuchAlgorithmException - on unsupported signaturealgorithms.
exception:
  NoSuchProviderException - if there's no default provider.
exception:
  SignatureException - on signature errors.
exception:
  CertificateException - on encoding errors.



verify
public synchronized void verify(PublicKey key, String sigProvider) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException(Code)
Throws an exception if the certificate was not signed using the verification key provided. Successfully verifying a certificate does not indicate that one should trust the entity which it represents.
Parameters:
  key - the public key used for verification.
Parameters:
  sigProvider - the name of the provider.
exception:
  NoSuchAlgorithmException - on unsupported signaturealgorithms.
exception:
  InvalidKeyException - on incorrect key.
exception:
  NoSuchProviderException - on incorrect provider.
exception:
  SignatureException - on signature errors.
exception:
  CertificateException - on encoding errors.



Methods inherited from java.security.cert.X509Certificate
abstract public void checkValidity() throws CertificateExpiredException, CertificateNotYetValidException(Code)(Java Doc)
abstract public void checkValidity(Date date) throws CertificateExpiredException, CertificateNotYetValidException(Code)(Java Doc)
abstract public int getBasicConstraints()(Code)(Java Doc)
public List getExtendedKeyUsage() throws CertificateParsingException(Code)(Java Doc)
public Collection getIssuerAlternativeNames() throws CertificateParsingException(Code)(Java Doc)
abstract public Principal getIssuerDN()(Code)(Java Doc)
abstract public boolean[] getIssuerUniqueID()(Code)(Java Doc)
public X500Principal getIssuerX500Principal()(Code)(Java Doc)
abstract public boolean[] getKeyUsage()(Code)(Java Doc)
abstract public Date getNotAfter()(Code)(Java Doc)
abstract public Date getNotBefore()(Code)(Java Doc)
abstract public BigInteger getSerialNumber()(Code)(Java Doc)
abstract public String getSigAlgName()(Code)(Java Doc)
abstract public String getSigAlgOID()(Code)(Java Doc)
abstract public byte[] getSigAlgParams()(Code)(Java Doc)
abstract public byte[] getSignature()(Code)(Java Doc)
public Collection getSubjectAlternativeNames() throws CertificateParsingException(Code)(Java Doc)
abstract public Principal getSubjectDN()(Code)(Java Doc)
abstract public boolean[] getSubjectUniqueID()(Code)(Java Doc)
public X500Principal getSubjectX500Principal()(Code)(Java Doc)
abstract public byte[] getTBSCertificate() throws CertificateEncodingException(Code)(Java Doc)
abstract public int getVersion()(Code)(Java Doc)

Methods inherited from java.security.Certificate
abstract public void decode(InputStream stream) throws KeyException, IOException(Code)(Java Doc)
abstract public void encode(OutputStream stream) throws KeyException, IOException(Code)(Java Doc)
abstract public String getFormat()(Code)(Java Doc)
abstract public Principal getGuarantor()(Code)(Java Doc)
abstract public Principal getPrincipal()(Code)(Java Doc)
abstract public PublicKey getPublicKey()(Code)(Java Doc)
public String toString(boolean detailed)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.