API java : X509CRL


java.security.cert
Class X509CRL

java.lang.Object
  extended by java.security.cert.CRL
      extended by java.security.cert.X509CRL
All Implemented Interfaces:
X509Extension

public abstract class X509CRL
extends CRL
implements X509Extension

Abstract class for an X.509 Certificate Revocation List (CRL). A CRL is a time-stamped list identifying revoked certificates. It is signed by a Certificate Authority (CA) and made freely available in a public repository.

Each revoked certificate is identified in a CRL by its certificate serial number. When a certificate-using system uses a certificate (e.g., for verifying a remote user's digital signature), that system not only checks the certificate signature and validity but also acquires a suitably- recent CRL and checks that the certificate serial number is not on that CRL. The meaning of "suitably-recent" may vary with local policy, but it usually means the most recently-issued CRL. A CA issues a new CRL on a regular periodic basis (e.g., hourly, daily, or weekly). Entries are added to CRLs as revocations occur, and an entry may be removed when the certificate expiration date is reached.

The X.509 v2 CRL format is described below in ASN.1:

  1. CertificateList ::= SEQUENCE {
  2. tbsCertList TBSCertList,
  3. signatureAlgorithm AlgorithmIdentifier,
  4. signature BIT STRING }

More information can be found in RFC 2459, "Internet X.509 Public Key Infrastructure Certificate and CRL Profile" at http://www.ietf.org/rfc/rfc2459.txt .

The ASN.1 definition of tbsCertList is:

  1. TBSCertList ::= SEQUENCE {
  2. version Version OPTIONAL,
  3. -- if present, must be v2
  4. signature AlgorithmIdentifier,
  5. issuer Name,
  6. thisUpdate ChoiceOfTime,
  7. nextUpdate ChoiceOfTime OPTIONAL,
  8. revokedCertificates SEQUENCE OF SEQUENCE {
  9. userCertificate CertificateSerialNumber,
  10. revocationDate ChoiceOfTime,
  11. crlEntryExtensions Extensions OPTIONAL
  12. -- if present, must be v2
  13. } OPTIONAL,
  14. crlExtensions [0] EXPLICIT Extensions OPTIONAL
  15. -- if present, must be v2
  16. }

CRLs are instantiated using a certificate factory. The following is an example of how to instantiate an X.509 CRL:

  1. <code>
  2. InputStream inStream = new FileInputStream("fileName-of-crl");
  3. CertificateFactory cf = CertificateFactory.getInstance("X.509");
  4. X509CRL crl = (X509CRL)cf.generateCRL(inStream);
  5. inStream.close();
  6. </code>

See Also:
CRL, CertificateFactory, X509Extension

Constructor Summary
protected X509CRL()
          Constructor for X.509 CRLs.
 
Method Summary
 boolean equals(Object other)
          Compares this CRL for equality with the given object.
abstract  byte[] getEncoded()
          Returns the ASN.1 DER-encoded form of this CRL.
abstract  Principal getIssuerDN()
          Denigrated, replaced by getIssuerX500Principal().
 X500Principal getIssuerX500Principal()
          Returns the issuer (issuer distinguished name) value from the CRL as an X500Principal.
abstract  Date getNextUpdate()
          Gets the nextUpdate date from the CRL.
abstract  X509CRLEntry getRevokedCertificate(BigInteger serialNumber)
          Gets the CRL entry, if any, with the given certificate serialNumber.
 X509CRLEntry getRevokedCertificate(X509Certificate certificate)
          Get the CRL entry, if any, for the given certificate.
abstract  Set<? extends X509CRLEntry> getRevokedCertificates()
          Gets all the entries from this CRL.
abstract  String getSigAlgName()
          Gets the signature algorithm name for the CRL signature algorithm.
abstract  String getSigAlgOID()
          Gets the signature algorithm OID string from the CRL.
abstract  byte[] getSigAlgParams()
          Gets the DER-encoded signature algorithm parameters from this CRL's signature algorithm.
abstract  byte[] getSignature()
          Gets the signature value (the raw signature bits) from the CRL.
abstract  byte[] getTBSCertList()
          Gets the DER-encoded CRL information, the tbsCertList from this CRL.
abstract  Date getThisUpdate()
          Gets the thisUpdate date from the CRL.
abstract  int getVersion()
          Gets the version (version number) value from the CRL.
 int hashCode()
          Returns a hashcode value for this CRL from its encoded form.
abstract  void verify(PublicKey key)
          Verifies that this CRL was signed using the private key that corresponds to the given public key.
abstract  void verify(PublicKey key, String sigProvider)
          Verifies that this CRL was signed using the private key that corresponds to the given public key.
 
Methods inherited from class java.security.cert.CRL
getType, isRevoked, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.security.cert.X509Extension
getCriticalExtensionOIDs, getExtensionValue, getNonCriticalExtensionOIDs, hasUnsupportedCriticalExtension
 

Constructor Detail

X509CRL

protected X509CRL()
Constructor for X.509 CRLs.

Method Detail

equals

public boolean equals(Object other)
Compares this CRL for equality with the given object. If the other object is an instanceof X509CRL, then its encoded form is retrieved and compared with the encoded form of this CRL.

Overrides:
equals in class Object
Parameters:
other - the object to test for equality with this CRL.
Returns:
true iff the encoded forms of the two CRLs match, false otherwise.
See Also:
Object.hashCode(), Hashtable

hashCode

public int hashCode()
Returns a hashcode value for this CRL from its encoded form.

Overrides:
hashCode in class Object
Returns:
the hashcode value.
See Also:
Object.equals(java.lang.Object), Hashtable

getEncoded

public abstract byte[] getEncoded()
                           throws CRLException
Returns the ASN.1 DER-encoded form of this CRL.

Returns:
the encoded form of this certificate
Throws:
CRLException - if an encoding error occurs.

verify

public abstract void verify(PublicKey key)
                     throws CRLException,
                            NoSuchAlgorithmException,
                            InvalidKeyException,
                            NoSuchProviderException,
                            SignatureException
Verifies that this CRL was signed using the private key that corresponds to the given public key.

Parameters:
key - the PublicKey used to carry out the verification.
Throws:
NoSuchAlgorithmException - on unsupported signature algorithms.
InvalidKeyException - on incorrect key.
NoSuchProviderException - if there's no default provider.
SignatureException - on signature errors.
CRLException - on encoding errors.

verify

public abstract void verify(PublicKey key,
                            String sigProvider)
                     throws CRLException,
                            NoSuchAlgorithmException,
                            InvalidKeyException,
                            NoSuchProviderException,
                            SignatureException
Verifies that this CRL was signed using the private key that corresponds to the given public key. This method uses the signature verification engine supplied by the given provider.

Parameters:
key - the PublicKey used to carry out the verification.
sigProvider - the name of the signature provider.
Throws:
NoSuchAlgorithmException - on unsupported signature algorithms.
InvalidKeyException - on incorrect key.
NoSuchProviderException - on incorrect provider.
SignatureException - on signature errors.
CRLException - on encoding errors.

getVersion

public abstract int getVersion()
Gets the version (version number) value from the CRL. The ASN.1 definition for this is:
  1. version Version OPTIONAL,
  2. -- if present, must be v2<p>
  3. Version ::= INTEGER { v1(0), v2(1), v3(2) }
  4. -- v3 does not apply to CRLs but appears for consistency
  5. -- with definition of Version for certs

Returns:
the version number, i.e. 1 or 2.

getIssuerDN

public abstract Principal getIssuerDN()
Denigrated, replaced by getIssuerX500Principal(). This method returns the issuer as an implementation specific Principal object, which should not be relied upon by portable code.

Gets the issuer (issuer distinguished name) value from the CRL. The issuer name identifies the entity that signed (and issued) the CRL.

The issuer name field contains an X.500 distinguished name (DN). The ASN.1 definition for this is:

  1. issuer Name
  2.  
  3. Name ::= CHOICE { RDNSequence }
  4. RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
  5. RelativeDistinguishedName ::=
  6. SET OF AttributeValueAssertion
  7.  
  8. AttributeValueAssertion ::= SEQUENCE {
  9. AttributeType,
  10. AttributeValue }
  11. AttributeType ::= OBJECT IDENTIFIER
  12. AttributeValue ::= ANY
The Name describes a hierarchical name composed of attributes, such as country name, and corresponding values, such as US. The type of the AttributeValue component is determined by the AttributeType; in general it will be a directoryString. A directoryString is usually one of PrintableString, TeletexString or UniversalString.

Returns:
a Principal whose name is the issuer distinguished name.

getIssuerX500Principal

public X500Principal getIssuerX500Principal()
Returns the issuer (issuer distinguished name) value from the CRL as an X500Principal.

It is recommended that subclasses override this method.

Returns:
an X500Principal representing the issuer distinguished name
Since:
1.4

getThisUpdate

public abstract Date getThisUpdate()
Gets the thisUpdate date from the CRL. The ASN.1 definition for this is:
  1. thisUpdate ChoiceOfTime
  2. ChoiceOfTime ::= CHOICE {
  3. utcTime UTCTime,
  4. generalTime GeneralizedTime }

Returns:
the thisUpdate date from the CRL.

getNextUpdate

public abstract Date getNextUpdate()
Gets the nextUpdate date from the CRL.

Returns:
the nextUpdate date from the CRL, or null if not present.

getRevokedCertificate

public abstract X509CRLEntry getRevokedCertificate(BigInteger serialNumber)
Gets the CRL entry, if any, with the given certificate serialNumber.

Parameters:
serialNumber - the serial number of the certificate for which a CRL entry is to be looked up
Returns:
the entry with the given serial number, or null if no such entry exists in this CRL.
See Also:
X509CRLEntry

getRevokedCertificate

public X509CRLEntry getRevokedCertificate(X509Certificate certificate)
Get the CRL entry, if any, for the given certificate.

This method can be used to lookup CRL entries in indirect CRLs, that means CRLs that contain entries from issuers other than the CRL issuer. The default implementation will only return entries for certificates issued by the CRL issuer. Subclasses that wish to support indirect CRLs should override this method.

Parameters:
certificate - the certificate for which a CRL entry is to be looked up
Returns:
the entry for the given certificate, or null if no such entry exists in this CRL.
Throws:
NullPointerException - if certificate is null
Since:
1.5

getRevokedCertificates

public abstract Set<? extends X509CRLEntry> getRevokedCertificates()
Gets all the entries from this CRL. This returns a Set of X509CRLEntry objects.

Returns:
all the entries or null if there are none present.
See Also:
X509CRLEntry

getTBSCertList

public abstract byte[] getTBSCertList()
                               throws CRLException
Gets the DER-encoded CRL information, the tbsCertList from this CRL. This can be used to verify the signature independently.

Returns:
the DER-encoded CRL information.
Throws:
CRLException - if an encoding error occurs.

getSignature

public abstract byte[] getSignature()
Gets the signature value (the raw signature bits) from the CRL. The ASN.1 definition for this is:
  1. signature BIT STRING

Returns:
the signature.

getSigAlgName

public abstract String getSigAlgName()
Gets the signature algorithm name for the CRL signature algorithm. An example is the string "SHA-1/DSA". The ASN.1 definition for this is:
  1. signatureAlgorithm AlgorithmIdentifier<p>
  2. AlgorithmIdentifier ::= SEQUENCE {
  3. algorithm OBJECT IDENTIFIER,
  4. parameters ANY DEFINED BY algorithm OPTIONAL }
  5. -- contains a value of the type
  6. -- registered for use with the
  7. -- algorithm object identifier value

The algorithm name is determined from the algorithm OID string.

Returns:
the signature algorithm name.

getSigAlgOID

public abstract String getSigAlgOID()
Gets the signature algorithm OID string from the CRL. An OID is represented by a set of nonnegative whole numbers separated by periods. For example, the string "1.2.840.10040.4.3" identifies the SHA-1 with DSA signature algorithm, as per RFC 2459.

See getSigAlgName for relevant ASN.1 definitions.

Returns:
the signature algorithm OID string.

getSigAlgParams

public abstract byte[] getSigAlgParams()
Gets the DER-encoded signature algorithm parameters from this CRL's signature algorithm. In most cases, the signature algorithm parameters are null; the parameters are usually supplied with the public key. If access to individual parameter values is needed then use AlgorithmParameters and instantiate with the name returned by getSigAlgName.

See getSigAlgName for relevant ASN.1 definitions.

Returns:
the DER-encoded signature algorithm parameters, or null if no parameters are present.

Ces informations proviennent du site de http://java.sun.com

Remarques

Contenu

Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :

Quels sont les motivations de cette démarche?

Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.

Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.

Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.

Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.

Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.

Réseaux sociaux

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.

 

Nuage de mots clés

7 mots clés dont 0 définis manuellement (plus d'information...).

Avertissement

Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.

 

Astuce pour imprimer les couleurs des cellules de tableaux : http://www.gaudry.be/ast-rf-450.html
Aucun commentaire pour cette page

© Ce document issu de l′infobrol est enregistré sous le certificat Cyber PrInterDeposit Digital Numbertection. Enregistrement IDDN n° 5329-1898
Document créé le 31/08/06 00:12, dernière modification le Vendredi 17 Juin 2011, 12:12
Source du document imprimé : http://www.gaudry.be/java-api-rf-java/security/cert/X509CRL.html Document affiché 1 fois ce mois de Juin.
St.Gaudry©07.01.02
Outils (masquer)
||
Recherche (afficher)
Recherche :

Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
15832 documents
452 astuces.
549 niouzes.
3099 definitions.
447 membres.
8115 messages.

Document genere en :
1,78 seconde

Mises à jour :
Mises à jour du site
Citation (masquer)
Pourquoi contredire une femme ? Il est tellement plus simple d'attendre qu'elle change d'avis.

Jean Anouilh
 
l'infobrol
Nous sommes le Vendredi 01 Juin 2012, 22:03, toutes les heures sont au format GMT+1.00 Heure, heure d'été (+1)