2 * Licensed to the University Corporation for Advanced Internet
3 * Development, Inc. (UCAID) under one or more contributor license
4 * agreements. See the NOTICE file distributed with this work for
5 * additional information regarding copyright ownership.
7 * UCAID licenses this file to you under the Apache License,
8 * Version 2.0 (the "License"); you may not use this file except
9 * in compliance with the License. You may obtain a copy of the
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
17 * either express or implied. See the License for the specific
18 * language governing permissions and limitations under the License.
22 * @file xmltooling/security/X509Credential.h
24 * Wraps an X.509-based Credential.
27 #if !defined(__xmltooling_x509cred_h__) && !defined(XMLTOOLING_NO_XMLSEC)
28 #define __xmltooling_x509cred_h__
30 #include <xmltooling/security/Credential.h>
34 namespace xmltooling {
36 class XMLTOOL_API XSECCryptoX509CRL;
39 * Wraps an X.509-based Credential.
41 class XMLTOOL_API X509Credential : public virtual Credential
47 virtual ~X509Credential();
50 * Bitmask constants for limiting resolution process inside a CredentialResolver.
58 * Bitmask of supported KeyInfo content to generate.
61 KEYINFO_X509_CERTIFICATE = 4,
62 KEYINFO_X509_SUBJECTNAME = 8,
63 KEYINFO_X509_ISSUERSERIAL = 16,
64 KEYINFO_X509_DIGEST = 32
68 * Gets an immutable collection of certificates in the entity's trust chain. The entity certificate is contained
69 * within this list. No specific ordering of the certificates is guaranteed.
71 * @return a certificate chain
73 virtual const std::vector<XSECCryptoX509*>& getEntityCertificateChain() const=0;
78 * Gets a CRL associated with the credential.
80 * @return CRL associated with the credential
82 virtual XSECCryptoX509CRL* getCRL() const=0;
85 * Gets an immutable collection of all CRLs associated with the credential.
87 * @return CRLs associated with the credential
89 virtual const std::vector<XSECCryptoX509CRL*>& getCRLs() const=0;
93 * Gets the subject name of the first certificate in the chain.
95 * @return the Subject DN
97 virtual const char* getSubjectName() const=0;
100 * Gets the issuer name of the first certificate in the chain.
102 * @return the Issuer DN
104 virtual const char* getIssuerName() const=0;
107 * Gets the serial number of the first certificate in the chain.
109 * @return the serial number
111 virtual const char* getSerialNumber() const=0;
114 * Extracts properties like issuer and subject from the first certificate in the chain.
116 virtual void extract()=0;
120 #endif /* __xmltooling_x509cred_h__ */