public abstract class Certificate extends Object
用于管理各种身份证件的抽象类。 身份证明书是公证人的担保,公钥是另一位校长的公钥。 (主体代表一个实体,如个人用户,一个团体或一个公司)。
该类是具有不同格式但重要常见用途的证书的抽象。 例如,不同类型的证书(如X.509和PGP)共享一般证书功能(如编码和验证)以及某些类型的信息(如公钥)。
X.509,PGP和SDSI证书都可以通过对证书类进行子类化来实现,即使它们包含不同的信息集,并且以不同的方式存储和检索信息。
注意:与早期版本的Java安全套接字扩展(JSSE) javax.security.cert存在包javax.security.cert的类。 应该使用新的应用程序使用位于java.security.cert的标准Java SE证书类。
X509Certificate
| Constructor and Description |
|---|
Certificate() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other)
将此证书与指定的对象进行比较。
|
abstract byte[] |
getEncoded()
返回此证书的编码形式。
|
abstract PublicKey |
getPublicKey()
从此证书获取公钥。
|
int |
hashCode()
从其编码形式返回此证书的哈希码值。
|
abstract String |
toString()
返回此证书的字符串表示形式。
|
abstract void |
verify(PublicKey key)
使用与指定公钥对应的私钥验证此证书是否已经签名。
|
abstract void |
verify(PublicKey key, String sigProvider)
使用与指定公钥对应的私钥验证此证书是否已经签名。
|
public boolean equals(Object other)
other对象是instanceof Certificate ,则其编码形式被检索并与该证书的编码形式进行比较。
equals在类别
Object
other - 测试与此证书相等的对象。
Object.hashCode() , HashMap
public int hashCode()
hashCode在类别
Object
Object.equals(java.lang.Object) ,
System.identityHashCode(java.lang.Object)
public abstract byte[] getEncoded()
throws CertificateEncodingException
CertificateEncodingException - 内部证书编码失败
public abstract void verify(PublicKey key) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException
key - 用于执行验证的PublicKey。
NoSuchAlgorithmException - 不支持的签名算法。
InvalidKeyException - 键错误。
NoSuchProviderException - 如果没有默认提供程序。
SignatureException - 签名错误。
CertificateException - 编码错误。
public abstract void verify(PublicKey key, String sigProvider) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException
key - 用于执行验证的PublicKey。
sigProvider - 签名提供者的名称。
NoSuchAlgorithmException - 不支持的签名算法。
InvalidKeyException - 键错误。
NoSuchProviderException - 错误提供者。
SignatureException - 签名错误。
CertificateException - 编码错误。
public abstract PublicKey getPublicKey()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.