1. Project Clover database Sat Feb 2 2019 06:45:20 CET
  2. Package org.xwiki.crypto.pkix.params.x509certificate.extension

File X509Extensions.java

 

Code metrics

0
0
0
1
138
27
0
-
-
0
-

Classes

Class Line # Actions
X509Extensions 34 0 - 0 0
-1.0 -
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.crypto.pkix.params.x509certificate.extension;
21   
22    import java.io.IOException;
23    import java.util.EnumSet;
24    import java.util.List;
25   
26    import org.bouncycastle.asn1.x509.Extension;
27   
28    /**
29    * X509 Extensions set.
30    *
31    * @version $Id: 9d5b817e97fd71210f418cd2290ba50e37f12cd7 $
32    * @since 5.4
33    */
 
34    public interface X509Extensions
35    {
36    /**
37    * OID of KeyUsage.
38    */
39    String BASIC_CONSTRAINTS_OID = Extension.basicConstraints.getId();
40   
41    /**
42    * OID of KeyUsage.
43    */
44    String KEY_USAGE_OID = Extension.keyUsage.getId();
45   
46    /**
47    * OID of ExtendedKeyUsage.
48    */
49    String EXTENDED_KEY_USAGE_OID = Extension.extendedKeyUsage.getId();
50   
51    /**
52    * OID of IssuerAltName.
53    */
54    String SUBJECT_ALT_NAME_OID = Extension.subjectAlternativeName.getId();
55   
56    /**
57    * OID of IssuerAltName.
58    */
59    String ISSUER_ALT_NAME_OID = Extension.issuerAlternativeName.getId();
60   
61    /**
62    * Gets the DER-encoded OCTET string for the extension value (extnValue) identified by the passed-in oid String.
63    *
64    * @param oid the oid to retrieve.
65    * @return a DER-encoded octet string or null if this extensions is absent.
66    */
67    byte[] getExtensionValue(String oid);
68   
69    /**
70    * Return true if the given oid has a critical extension.
71    *
72    * @param oid the oid to check.
73    * @return true if the given oid has a critical extension.
74    */
75    boolean isCritical(String oid);
76   
77    /**
78    * @return the array of OID strings in this extensions set.
79    */
80    String[] getExtensionOID();
81   
82    /**
83    * @return the array of OID strings in this extensions set marked critical.
84    */
85    String[] getCriticalExtensionOID();
86   
87    /**
88    * @return the array of OID strings in this extensions set marked non-critical.
89    */
90    String[] getNonCriticalExtensionOID();
91   
92    /**
93    * @return the ASN.1 encoded form of the extensions set.
94    * @throws IOException on encoding error.
95    */
96    byte[] getEncoded() throws IOException;
97   
98    /**
99    * @return true if these extensions identify a Certificate Authority.
100    */
101    boolean hasCertificateAuthorityBasicConstraints();
102   
103    /**
104    * @return a positive integer representing the path len constraints of a Certificate Authority, or -1 if there is
105    * no such constraints.
106    */
107    int getBasicConstraintsPathLen();
108   
109    /**
110    * @return the set of key usages authorized, or null of none has been assigned.
111    */
112    EnumSet<KeyUsage> getKeyUsage();
113   
114    /**
115    * @return the set of extended key usages authorized, or null of none has been assigned.
116    */
117    ExtendedKeyUsages getExtendedKeyUsage();
118   
119    /**
120    * @return the authority key identifier, or null of none has been assigned.
121    */
122    byte[] getAuthorityKeyIdentifier();
123   
124    /**
125    * @return the subject key identifier, or null of none has been assigned.
126    */
127    byte[] getSubjectKeyIdentifier();
128   
129    /**
130    * @return additional identities bound to the subject of the certificate.
131    */
132    List<X509GeneralName> getSubjectAltName();
133   
134    /**
135    * @return additional identities bound to the issuer of the certificate.
136    */
137    List<X509GeneralName> getIssuerAltName();
138    }