Botan 2.13.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | List of all members
Botan::Cert_Extension::Subject_Key_ID Class Referencefinal

`#include <x509_ext.h>`

Inheritance diagram for Botan::Cert_Extension::Subject_Key_ID:

## Public Member Functions
Subject_Key_ID * | copy () const override
const std::vector< uint8_t > & | get_key_id () const
OID | oid_of () const override
| Subject_Key_ID ()=default
| Subject_Key_ID (const std::vector< uint8_t > &k)
| Subject_Key_ID (const std::vector< uint8_t > &public_key, const std::string &hash_fn)
virtual void | validate (const X509_Certificate &subject, const X509_Certificate &issuer, const std::vector< std::shared_ptr< const X509_Certificate >> &cert_path, std::vector< std::set< Certificate_Status_Code >> &cert_status, size_t pos)

## Static Public Member Functions
static OID | static_oid ()

## Detailed Description

Subject Key Identifier Extension

Definition at line 353 of file x509_ext.h.

## Constructor & Destructor Documentation

Botan::Cert_Extension::Subject_Key_ID::Subject_Key_ID | ( |  | ) |
| default

Botan::Cert_Extension::Subject_Key_ID::Subject_Key_ID | ( | const std::vector< uint8_t > & | k | ) |
| inline explicit

Definition at line 358 of file x509_ext.h.

358 : m_key_id(k) {}

Botan::Cert_Extension::Subject_Key_ID::Subject_Key_ID | ( | const std::vector< uint8_t > & | public_key,
|  | const std::string & | hash_fn
| ) |  |

Definition at line 458 of file x509_ext.cpp.

References Botan::HashFunction::create_or_throw(), and hash.

459 {
460 std::unique_ptr<HashFunction> hash(HashFunction::create_or_throw(hash_name));
461
462 m_key_id.resize(hash->output_length());
463
464 hash->update(pub_key);
465 hash->final(m_key_id.data());
466
467 // Truncate longer hashes, 192 bits here seems plenty
468 const size_t max_skid_len = (192 / 8);
469 if(m_key_id.size() > max_skid_len)
470 m_key_id.resize(max_skid_len);
471 }
Botan::HashFunction::create_or_throw
static std::unique_ptr< HashFunction > create_or_throw(const std::string &algo_spec, const std::string &provider="")
Definition: hash.cpp:344
hash
MechanismType hash
Definition: p11_mechanism.cpp:64

## Member Function Documentation

Subject_Key_ID* Botan::Cert_Extension::Subject_Key_ID::copy | ( |  | ) | const
| inline override virtual

Make a copy of this extension

Returns
  copy of this

Implements Botan::Certificate_Extension.

Definition at line 363 of file x509_ext.h.

364 { return new Subject_Key_ID(m_key_id); }
Botan::Cert_Extension::Subject_Key_ID::Subject_Key_ID
Subject_Key_ID()=default

const std::vector<uint8_t>& Botan::Cert_Extension::Subject_Key_ID::get_key_id | ( |  | ) | const
| inline

Definition at line 366 of file x509_ext.h.

366 { return m_key_id; }

OID Botan::Cert_Extension::Subject_Key_ID::oid_of | ( |  | ) | const
| inline override virtual

Returns
  OID representing this extension

Implements Botan::Certificate_Extension.

Definition at line 369 of file x509_ext.h.

369 { return static_oid(); }
Botan::Cert_Extension::Subject_Key_ID::static_oid
static OID static_oid()
Definition: x509_ext.h:368

static OID Botan::Cert_Extension::Subject_Key_ID::static_oid | ( |  | ) |
| inline static

Definition at line 368 of file x509_ext.h.

368 { return OID("2.5.29.14"); }

void Botan::Certificate_Extension::validate | ( | const X509_Certificate & | subject,
|  | const X509_Certificate & | issuer,
|  | const std::vector< std::shared_ptr< const X509_Certificate >> & | cert_path,
|  | std::vector< std::set< Certificate_Status_Code >> & | cert_status,
|  | size_t | pos
| ) |  |
| virtual inherited

Reimplemented in Botan::Cert_Extension::Unknown_Extension, Botan::Cert_Extension::Certificate_Policies, and Botan::Cert_Extension::Name_Constraints.

Definition at line 113 of file x509_ext.cpp.

117 {
118 }

The documentation for this class was generated from the following files:

- src/lib/x509/x509_ext.h
- src/lib/x509/x509_ext.cpp