| 
JavaTM 2 Platform Standard Ed. 5.0  | 
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjava.security.cert.CRL
java.security.cert.X509CRL
public abstract class X509CRL
X.509 证书撤消列表 (CRL) 的抽象类。CRL 是标识已撤消证书的时间戳列表。它由证书颁发机构 (CA) 签署并且可在公共存储库中随意使用。
在 CRL 中,通过每个已撤消证书的证书序列号来标识该证书。当使用证书的系统使用某个证书(例如,用它验证远程用户的数字签名)时,该系统不仅要检查该证书的签名和有效性,而且还要获得一个最近合适的 CRL,并检查该证书序列号在不在该 CRL 中。“最近合适”的含义可能随本地策略的不同而有所不同,但是它通常指的是最近发布的 CRL。CA 定期发布新的 CRL(例如每小时、每日、每周)。当撤消发生时向 CRL 添加一个项,而到达证书的终止日期时,可能会移除一个项。
X.509 v2 CRL 格式的 ASN.1 描述如下:
 CertificateList  ::=  SEQUENCE  {
     tbsCertList          TBSCertList,
     signatureAlgorithm   AlgorithmIdentifier,
     signature            BIT STRING  }
 
 在 RFC 2459,即 "Internet X.509 Public Key Infrastructure Certificate and CRL Profile"(位于 http://www.ietf.org/rfc/rfc2459.txt )中可找到更多信息。
tbsCertList 的 ASN.1 定义是:
 
 TBSCertList  ::=  SEQUENCE  {
     version                 Version OPTIONAL,
                             -- if present, must be v2
     signature               AlgorithmIdentifier,
     issuer                  Name,
     thisUpdate              ChoiceOfTime,
     nextUpdate              ChoiceOfTime OPTIONAL,
     revokedCertificates     SEQUENCE OF SEQUENCE  {
         userCertificate         CertificateSerialNumber,
         revocationDate          ChoiceOfTime,
         crlEntryExtensions      Extensions OPTIONAL
                                 -- if present, must be v2
         }  OPTIONAL,
     crlExtensions           [0]  EXPLICIT Extensions OPTIONAL
                                  -- if present, must be v2
     }
 
 CRL 是使用证书工厂进行实例化的。下面的示例演示了如何实例化一个 X.509 CRL:
 
 InputStream inStream = new FileInputStream("fileName-of-crl");
 CertificateFactory cf = CertificateFactory.getInstance("X.509");
 X509CRL crl = (X509CRL)cf.generateCRL(inStream);
 inStream.close();
 
CRL, 
CertificateFactory, 
X509Extension| 构造方法摘要 | |
|---|---|
protected  | 
X509CRL()
X.509 CRL 的构造方法。  | 
| 方法摘要 | |
|---|---|
 boolean | 
equals(Object other)
比较此 CRL 与给定对象的相等性。  | 
abstract  byte[] | 
getEncoded()
返回此 CRL 的 ASN.1 DER 编码形式。  | 
abstract  Principal | 
getIssuerDN()
已过时,由 getIssuerX500Principal() 替代。  | 
 X500Principal | 
getIssuerX500Principal()
以 X500Principal 的形式返回 CRL 的发布方(发布方标识名)值。 | 
abstract  Date | 
getNextUpdate()
获得 CRL 的 nextUpdate 日期。 | 
abstract  X509CRLEntry | 
getRevokedCertificate(BigInteger serialNumber)
获得具有给定证书 serialNumber 的 CRL 项(如果有)。  | 
 X509CRLEntry | 
getRevokedCertificate(X509Certificate certificate)
获得给定证书的 CRL 项(如果有)。  | 
abstract  Set<? extends X509CRLEntry> | 
getRevokedCertificates()
获得此 CRL 中的所有项。  | 
abstract  String | 
getSigAlgName()
获得 CRL 签名算法的签名算法名。  | 
abstract  String | 
getSigAlgOID()
获得 CRL 的签名算法 OID 字符串。  | 
abstract  byte[] | 
getSigAlgParams()
获得此 CRL 的签名算法中 DER 编码形式的签名算法参数。  | 
abstract  byte[] | 
getSignature()
获得 CRL 的 signature 值(原始签名位)。 | 
abstract  byte[] | 
getTBSCertList()
从此 CRL 中获得以 DER 编码的 CRL 信息,即 tbsCertList。 | 
abstract  Date | 
getThisUpdate()
获得 CRL 的 thisUpdate 日期。 | 
abstract  int | 
getVersion()
获得 CRL 的 version(版本号)值。 | 
 int | 
hashCode()
根据此 CRL 的编码形式返回该 CRL 的哈希码值。  | 
abstract  void | 
verify(PublicKey key)
验证是否已使用与给定公钥相应的私钥签署了此 CRL。  | 
abstract  void | 
verify(PublicKey key,
       String sigProvider)
验证是否已使用与给定公钥相应的私钥签署了此 CRL。  | 
| 从类 java.security.cert.CRL 继承的方法 | 
|---|
getType, isRevoked, toString | 
| 从类 java.lang.Object 继承的方法 | 
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait | 
| 从接口 java.security.cert.X509Extension 继承的方法 | 
|---|
getCriticalExtensionOIDs, getExtensionValue, getNonCriticalExtensionOIDs, hasUnsupportedCriticalExtension | 
| 构造方法详细信息 | 
|---|
protected X509CRL()
| 方法详细信息 | 
|---|
public boolean equals(Object other)
other 对象是一个 instanceof X509CRL,则检索其编码形式并且与此 CRL 的编码形式进行比较。
Object 中的 equalsother - 要与此 CRL 进行相等性测试的对象。
Object.hashCode(), 
Hashtablepublic int hashCode()
Object 中的 hashCodeObject.equals(java.lang.Object), 
Hashtable
public abstract byte[] getEncoded()
                           throws CRLException
CRLException - 如果发生编码错误。
public abstract void verify(PublicKey key)
                     throws CRLException,
                            NoSuchAlgorithmException,
                            InvalidKeyException,
                            NoSuchProviderException,
                            SignatureException
key - 用于进行验证的 PublicKey。
NoSuchAlgorithmException - 如果签名算法不受支持。
InvalidKeyException - 如果密钥不正确。
NoSuchProviderException - 如果没有默认的提供程序。
SignatureException - 如果发生签名错误。
CRLException - 如果发生编码错误。
public abstract void verify(PublicKey key,
                            String sigProvider)
                     throws CRLException,
                            NoSuchAlgorithmException,
                            InvalidKeyException,
                            NoSuchProviderException,
                            SignatureException
key - 用于进行验证的 PublicKey。sigProvider - 签名提供程序的名称。
NoSuchAlgorithmException - 如果签名算法不受支持。
InvalidKeyException - 如果密钥不正确。
NoSuchProviderException - 如果提供程序不正确。
SignatureException - 如果发生签名错误。
CRLException - 如果发生编码错误。public abstract int getVersion()
version(版本号)值。此内容的 ASN.1 定义如下:
 
 version    Version OPTIONAL,
             -- if present, must be v2
 Version  ::=  INTEGER  {  v1(0), v2(1), v3(2)  }
             -- v3 does not apply to CRLs but appears for consistency
             -- with definition of Version for certs
 
public abstract Principal getIssuerDN()
issuer,可移植的代码不应依靠该对象。
 
获得 CRL 的 issuer(发布方的标识名)。发布方名称标识了签署(并发布)该 CRL 的实体。
 
发布方名称字段包含一个 X.500 标识名 (DN)。此内容的 ASN.1 定义如下:
 issuer    Name
 Name ::= CHOICE { RDNSequence }
 RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
 RelativeDistinguishedName ::=
     SET OF AttributeValueAssertion
 AttributeValueAssertion ::= SEQUENCE {
                               AttributeType,
                               AttributeValue }
 AttributeType ::= OBJECT IDENTIFIER
 AttributeValue ::= ANY
 
Name 描述了一个层次结构名,由属性(如国家/地区名)和相应值(如 US)组成。AttributeValue 组件的类型由 AttributeType 来确定;一般是 directoryString。directoryString 通常是 PrintableString、TeletexString 或 UniversalString 之一。
public X500Principal getIssuerX500Principal()
X500Principal 的形式返回 CRL 的发布方(发布方标识名)值。
 建议子类重写此方法。
X500Principalpublic abstract Date getThisUpdate()
thisUpdate 日期。此内容的 ASN.1 定义如下:
 
 thisUpdate   ChoiceOfTime
 ChoiceOfTime ::= CHOICE {
     utcTime        UTCTime,
     generalTime    GeneralizedTime }
 
thisUpdate 日期。public abstract Date getNextUpdate()
nextUpdate 日期。
nextUpdate 日期,如果不存在,则返回 null。public abstract X509CRLEntry getRevokedCertificate(BigInteger serialNumber)
serialNumber - 要查找其 CRL 项的证书的序列号
X509CRLEntrypublic X509CRLEntry getRevokedCertificate(X509Certificate certificate)
此方法可用于在间接 CRL 中查找 CRL 项,间接 CRL 意味着其中包含来自不同于 CRL 发布方的发布方的项。默认的实现只返回由 CRL 发布方所发布的证书项。希望支持间接 CRL 的子类应该重写此方法。
certificate - 证书,在 CRL 中查找此证书的 CRL 项
NullPointerException - 如果 certificate 为 nullpublic abstract Set<? extends X509CRLEntry> getRevokedCertificates()
X509CRLEntry
public abstract byte[] getTBSCertList()
                               throws CRLException
tbsCertList。这可用于独立验证签名。
CRLException - 如果发生编码错误。public abstract byte[] getSignature()
signature 值(原始签名位)。此内容的 ASN.1 定义如下:
 signature BIT STRING
public abstract String getSigAlgName()
signatureAlgorithm AlgorithmIdentifierAlgorithmIdentifier ::= SEQUENCE { algorithm OBJECT IDENTIFIER, parameters ANY DEFINED BY algorithm OPTIONAL } -- contains a value of the type -- registered for use with the -- algorithm object identifier value
根据 algorithm OID 字符串确定该算法名。
public abstract String getSigAlgOID()
有关相关的 ASN.1 定义,请参见 getSigAlgName。
public abstract byte[] getSigAlgParams()
AlgorithmParameters 并使用 getSigAlgName 所返回的名称进行实例化。
 
有关相关的 ASN.1 定义,请参见 getSigAlgName。
  | 
JavaTM 2 Platform Standard Ed. 5.0  | 
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。