1 /* Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd All Rights Reserved
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License
16 * @file client-certificate-impl.h
17 * @author Barlomiej Grzelewski (b.grzelewski@samsung.com)
19 * @brief Certificate Implmentation.
26 #include <ckm/ckm-type.h>
27 #include <ckm/ckm-certificate.h>
29 #include <generic-key.h>
33 class CertificateImpl : public Certificate {
36 CertificateImpl(X509* x509);
37 CertificateImpl(const SafeBuffer &data, DataFormat format);
38 CertificateImpl(const RawBuffer &data, DataFormat format);
39 CertificateImpl(const CertificateImpl &);
40 CertificateImpl(CertificateImpl &&);
41 CertificateImpl& operator=(const CertificateImpl &);
42 CertificateImpl& operator=(CertificateImpl &&);
44 virtual RawBuffer getDER() const;
45 virtual bool empty() const;
46 virtual X509* getX509() const;
48 SafeBuffer getDERSB() const;
50 GenericKey::EvpShPtr getEvpShPtr() const;
51 GenericKey getGenericKey() const;
53 std::string getOneLine(CertificateFieldId type) const;
54 std::string getField(CertificateFieldId type, int fieldNid) const;
55 std::string getCommonName(CertificateFieldId type) const;
56 std::string getCountryName(CertificateFieldId type) const;
57 std::string getStateOrProvinceName(CertificateFieldId type) const;
58 std::string getLocalityName(CertificateFieldId type) const;
59 std::string getOrganizationName(CertificateFieldId type) const;
60 std::string getOrganizationalUnitName(CertificateFieldId type) const;
61 std::string getEmailAddres(CertificateFieldId type) const;
62 std::string getOCSPURL() const;
64 virtual ~CertificateImpl();
69 typedef std::vector<CertificateImpl> CertificateImplVector;