Package org.bouncycastle.tls
Class CertificateRequest
java.lang.Object
org.bouncycastle.tls.CertificateRequest
Parsing and encoding of a CertificateRequest struct from RFC 4346:
struct { ClientCertificateType certificate_types<1..2^8-1>; DistinguishedName certificate_authorities<3..2^16-1>; } CertificateRequest;Updated for RFC 5246:
struct { ClientCertificateType certificate_types<1..2^8-1>; SignatureAndHashAlgorithm supported_signature_algorithms<2^16-1>; DistinguishedName certificate_authorities<0..2^16-1>; } CertificateRequest;Revised for RFC 8446:
struct { opaque certificate_request_context<0..2^8-1>; Extension extensions<2..2^16-1>; } CertificateRequest;
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCertificateRequest
(byte[] certificateRequestContext, Vector supportedSignatureAlgorithms, Vector supportedSignatureAlgorithmsCert, Vector certificateAuthorities) CertificateRequest
(short[] certificateTypes, Vector supportedSignatureAlgorithms, Vector certificateAuthorities) -
Method Summary
Modifier and TypeMethodDescriptionvoid
encode
(TlsContext context, OutputStream output) Encode thisCertificateRequest
to anOutputStream
.byte[]
short[]
boolean
hasCertificateRequestContext
(byte[] certificateRequestContext) static CertificateRequest
parse
(TlsContext context, InputStream input) Parse aCertificateRequest
from anInputStream
.
-
Field Details
-
certificateRequestContext
protected final byte[] certificateRequestContext -
certificateTypes
protected final short[] certificateTypes -
supportedSignatureAlgorithms
-
supportedSignatureAlgorithmsCert
-
certificateAuthorities
-
-
Constructor Details
-
CertificateRequest
public CertificateRequest(short[] certificateTypes, Vector supportedSignatureAlgorithms, Vector certificateAuthorities) - Parameters:
certificateTypes
- seeClientCertificateType
for valid constants.certificateAuthorities
- aVector
ofX500Name
.
-
CertificateRequest
public CertificateRequest(byte[] certificateRequestContext, Vector supportedSignatureAlgorithms, Vector supportedSignatureAlgorithmsCert, Vector certificateAuthorities) throws IOException - Throws:
IOException
-
-
Method Details
-
getCertificateRequestContext
public byte[] getCertificateRequestContext() -
getCertificateTypes
public short[] getCertificateTypes()- Returns:
- an array of certificate types
- See Also:
-
getSupportedSignatureAlgorithms
- Returns:
- a
Vector
ofSignatureAndHashAlgorithm
(or null before TLS 1.2).
-
getSupportedSignatureAlgorithmsCert
- Returns:
- an optional
Vector
ofSignatureAndHashAlgorithm
. May be non-null from TLS 1.3 onwards.
-
getCertificateAuthorities
- Returns:
- a
Vector
ofX500Name
-
hasCertificateRequestContext
public boolean hasCertificateRequestContext(byte[] certificateRequestContext) -
encode
Encode thisCertificateRequest
to anOutputStream
.- Parameters:
context
- theTlsContext
of the current connection.output
- theOutputStream
to encode to.- Throws:
IOException
-
parse
Parse aCertificateRequest
from anInputStream
.- Parameters:
context
- theTlsContext
of the current connection.input
- theInputStream
to parse from.- Returns:
- a
CertificateRequest
object. - Throws:
IOException
-