⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 x509certificate.java

📁 JAVA基本类源代码,大家可以学习学习!
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
     * the certificate.     * The ASN.1 definition for this is:     * <pre>     * signature     BIT STRING       * </pre>     *     * @return the signature.     */    public abstract byte[] getSignature();    /**     * Gets the signature algorithm name for the certificate     * signature algorithm. An example is the string "SHA-1/DSA".     * The ASN.1 definition for this is:     * <pre>     * signatureAlgorithm   AlgorithmIdentifier<p>     * AlgorithmIdentifier  ::=  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     * </pre>     *      * <p>The algorithm name is determined from the <code>algorithm</code>     * OID string.     *     * @return the signature algorithm name.     */    public abstract String getSigAlgName();    /**     * Gets the signature algorithm OID string from the certificate.     * 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.     *      * <p>See {@link #getSigAlgName() getSigAlgName} for      * relevant ASN.1 definitions.     *     * @return the signature algorithm OID string.     */    public abstract String getSigAlgOID();    /**     * Gets the DER-encoded signature algorithm parameters from this     * certificate's signature algorithm. In most cases, the signature     * algorithm parameters are null; the parameters are usually     * supplied with the certificate's public key.     * If access to individual parameter values is needed then use     * {@link java.security.AlgorithmParameters AlgorithmParameters}     * and instantiate with the name returned by     * {@link #getSigAlgName() getSigAlgName}.     *      * <p>See {@link #getSigAlgName() getSigAlgName} for      * relevant ASN.1 definitions.     *     * @return the DER-encoded signature algorithm parameters, or     *         null if no parameters are present.     */    public abstract byte[] getSigAlgParams();    /**     * Gets the <code>issuerUniqueID</code> value from the certificate.     * The issuer unique identifier is present in the certificate     * to handle the possibility of reuse of issuer names over time.     * RFC 2459 recommends that names not be reused and that     * conforming certificates not make use of unique identifiers.     * Applications conforming to that profile should be capable of     * parsing unique identifiers and making comparisons.     *      * <p>The ASN.1 definition for this is:     * <pre>     * issuerUniqueID  [1]  IMPLICIT UniqueIdentifier OPTIONAL<p>     * UniqueIdentifier  ::=  BIT STRING     * </pre>     *     * @return the issuer unique identifier or null if it is not     * present in the certificate.     */    public abstract boolean[] getIssuerUniqueID();    /**     * Gets the <code>subjectUniqueID</code> value from the certificate.     *      * <p>The ASN.1 definition for this is:     * <pre>     * subjectUniqueID  [2]  IMPLICIT UniqueIdentifier OPTIONAL<p>     * UniqueIdentifier  ::=  BIT STRING     * </pre>     *     * @return the subject unique identifier or null if it is not     * present in the certificate.     */    public abstract boolean[] getSubjectUniqueID();       /**     * Gets a boolean array representing bits of     * the <code>KeyUsage</code> extension, (OID = 2.5.29.15).     * The key usage extension defines the purpose (e.g., encipherment,     * signature, certificate signing) of the key contained in the     * certificate.     * The ASN.1 definition for this is:     * <pre>     * KeyUsage ::= BIT STRING {     *     digitalSignature        (0),     *     nonRepudiation          (1),     *     keyEncipherment         (2),     *     dataEncipherment        (3),     *     keyAgreement            (4),     *     keyCertSign             (5),     *     cRLSign                 (6),     *     encipherOnly            (7),     *     decipherOnly            (8) }     * </pre>     * RFC 2459 recommends that when used, this be marked     * as a critical extension.     *     * @return the KeyUsage extension of this certificate, represented as     * an array of booleans. The order of KeyUsage values in the array is     * the same as in the above ASN.1 definition. The array will contain a     * value for each KeyUsage defined above. If the KeyUsage list encoded     * in the certificate is longer than the above list, it will not be     * truncated. Returns null if this certificate does not     * contain a KeyUsage extension.     */    public abstract boolean[] getKeyUsage();        /**     * Gets an unmodifiable list of Strings representing the OBJECT     * IDENTIFIERs of the <code>ExtKeyUsageSyntax</code> field of the     * extended key usage extension, (OID = 2.5.29.37).  It indicates     * one or more purposes for which the certified public key may be     * used, in addition to or in place of the basic purposes     * indicated in the key usage extension field.  The ASN.1     * definition for this is:     * <pre>     * ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId<p>     *     * KeyPurposeId ::= OBJECT IDENTIFIER<p>     * </pre>     *     * Key purposes may be defined by any organization with a     * need. Object identifiers used to identify key purposes shall be     * assigned in accordance with IANA or ITU-T Rec. X.660 |     * ISO/IEC/ITU 9834-1.     * <p>     * This method was added to version 1.4 of the Java 2 Platform Standard      * Edition. In order to maintain backwards compatibility with existing      * service providers, this method is not <code>abstract</code>     * and it provides a default implementation. Subclasses     * should override this method with a correct implementation.     *     * @return the ExtendedKeyUsage extension of this certificate,     *         as an unmodifiable list of object identifiers represented     *         as Strings. Returns null if this certificate does not     *         contain an ExtendedKeyUsage extension.     * @throws CertificateParsingException if the extension cannot be decoded     * @since 1.4     */    public List getExtendedKeyUsage() throws CertificateParsingException {	return X509CertImpl.getExtendedKeyUsage(this);    }    /**     * Gets the certificate constraints path length from the     * critical <code>BasicConstraints</code> extension, (OID = 2.5.29.19).     * <p>     * The basic constraints extension identifies whether the subject     * of the certificate is a Certificate Authority (CA) and      * how deep a certification path may exist through that CA. The      * <code>pathLenConstraint</code> field (see below) is meaningful     * only if <code>cA</code> is set to TRUE. In this case, it gives the     * maximum number of CA certificates that may follow this certificate in a     * certification path. A value of zero indicates that only an end-entity     * certificate may follow in the path.     * <p>     * Note that for RFC 2459 this extension is always marked     * critical if <code>cA</code> is TRUE, meaning this certificate belongs     * to a Certificate Authority.     * <p>     * The ASN.1 definition for this is:     * <pre>     * BasicConstraints ::= SEQUENCE {     *     cA                  BOOLEAN DEFAULT FALSE,     *     pathLenConstraint   INTEGER (0..MAX) OPTIONAL }     * </pre>     *     * @return the value of <code>pathLenConstraint</code> if the     * BasicConstraints extension is present in the certificate and the     * subject of the certificate is a CA, otherwise -1.     * If the subject of the certificate is a CA and     * <code>pathLenConstraint</code> does not appear,     * <code>Integer.MAX_VALUE</code> is returned to indicate that there is no     * limit to the allowed length of the certification path.     */    public abstract int getBasicConstraints();    /**     * Gets an immutable collection of subject alternative names from the     * <code>SubjectAltName</code> extension, (OID = 2.5.29.17).     * <p>     * The ASN.1 definition of the <code>SubjectAltName</code> extension is:     * <pre>     * SubjectAltName ::= GeneralNames     *     * GeneralNames :: = SEQUENCE SIZE (1..MAX) OF GeneralName     *     * GeneralName ::= CHOICE {     *      otherName                       [0]     OtherName,     *      rfc822Name                      [1]     IA5String,     *      dNSName                         [2]     IA5String,     *      x400Address                     [3]     ORAddress,     *      directoryName                   [4]     Name,     *      ediPartyName                    [5]     EDIPartyName,     *      uniformResourceIdentifier       [6]     IA5String,     *      iPAddress                       [7]     OCTET STRING,     *      registeredID                    [8]     OBJECT IDENTIFIER}     * </pre>     * <p>     * If this certificate does not contain a <code>SubjectAltName</code>     * extension, <code>null</code> is returned. Otherwise, a      * <code>Collection</code> is returned with an entry representing each      * <code>GeneralName</code> included in the extension. Each entry is a      * <code>List</code> whose first entry is an <code>Integer</code>      * (the name type, 0-8) and whose second entry is a <code>String</code>      * or a byte array (the name, in string or ASN.1 DER encoded form,      * respectively).     * <p>     * RFC 822, DNS, and URI names are returned as <code>String</code>s,      * using the well-established string formats for those types (subject to     * the restrictions included in RFC 2459). IPv4 address names are      * returned using dotted quad notation. IPv6 address names are returned     * in the form "a1:a2:...:a8", where a1-a8 are hexadecimal values      * representing the eight 16-bit pieces of the address. OID names are      * returned as <code>String</code>s represented as a series of nonnegative      * integers separated by periods. And directory names (distinguished names)      * are returned in RFC 2253 string format. No standard string format is      * defined for otherNames, X.400 names, EDI party names, or any      * other type of names. They are returned as byte arrays      * containing the ASN.1 DER encoded form of the name.     * <p>     * Note that the <code>Collection</code> returned may contain more     * than one name of the same type. Also, note that the returned     * <code>Collection</code> is immutable and any entries containing byte      * arrays are cloned to protect against subsequent modifications.     * <p>     * This method was added to version 1.4 of the Java 2 Platform Standard      * Edition. In order to maintain backwards compatibility with existing      * service providers, this method is not <code>abstract</code>     * and it provides a default implementation. Subclasses     * should override this method with a correct implementation.     *     * @return an immutable <code>Collection</code> of subject alternative      * names (or <code>null</code>)     * @throws CertificateParsingException if the extension cannot be decoded     * @since 1.4     */    public Collection getSubjectAlternativeNames()	throws CertificateParsingException {	return X509CertImpl.getSubjectAlternativeNames(this);    }    /**     * Gets an immutable collection of issuer alternative names from the     * <code>IssuerAltName</code> extension, (OID = 2.5.29.18).     * <p>     * The ASN.1 definition of the <code>IssuerAltName</code> extension is:     * <pre>     * IssuerAltName ::= GeneralNames     * </pre>     * The ASN.1 definition of <code>GeneralNames</code> is defined     * in {@link #getSubjectAlternativeNames getSubjectAlternativeNames}.     * <p>     * If this certificate does not contain an <code>IssuerAltName</code>     * extension, <code>null</code> is returned. Otherwise, a      * <code>Collection</code> is returned with an entry representing each      * <code>GeneralName</code> included in the extension. Each entry is a      * <code>List</code> whose first entry is an <code>Integer</code>      * (the name type, 0-8) and whose second entry is a <code>String</code>      * or a byte array (the name, in string or ASN.1 DER encoded form,      * respectively). For more details about the formats used for each     * name type, see the <code>getSubjectAlternativeNames</code> method.     * <p>     * Note that the <code>Collection</code> returned may contain more     * than one name of the same type. Also, note that the returned     * <code>Collection</code> is immutable and any entries containing byte      * arrays are cloned to protect against subsequent modifications.     * <p>     * This method was added to version 1.4 of the Java 2 Platform Standard      * Edition. In order to maintain backwards compatibility with existing      * service providers, this method is not <code>abstract</code>     * and it provides a default implementation. Subclasses     * should override this method with a correct implementation.     *     * @return an immutable <code>Collection</code> of issuer alternative      * names (or <code>null</code>)     * @throws CertificateParsingException if the extension cannot be decoded     * @since 1.4     */    public Collection getIssuerAlternativeNames()	throws CertificateParsingException {	return X509CertImpl.getIssuerAlternativeNames(this);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -