keychain_did Class
namespace keychain
→ class keychain_did
Overview
The keychain_did
class represents a DID for a specific keychain (encryption or signature). Each keychain has its own DID that identifies the sequence of public keys used over the device’s lifetime for a particular cryptographic operation type.
Class Hierarchy
namespace keychain {
class keychain_did : public did {
// DID for a specific keychain (encryption or signature)
};
}
Constructor
keychain_did();
keychain_did(const std::string& did_string);
keychain_did(keychain_type type, const std::string& identifier);
keychain_did(const keychain_did& other);
Properties
Static Methods
static keychain_did from_keychain(const keychain& kc);
static bool is_keychain_did_string(const std::string& did_string);
Factory method to create a keychain DID from a keychain object and validation helper.
Example Usage
#include <keychain/keychain.hpp>
// Create encryption keychain DID
keychain::keychain_did encr_did(keychain::keychain_type::encryption, "abc123...");
// Parse from string
keychain::keychain_did parsed_did("did:kc:encr:abc123...");
// Check type
if (parsed_did.is_encryption_keychain()) {
std::cout << "This is an encryption keychain DID" << std::endl;
}
// Create from existing keychain
keychain::keychain my_keychain;
auto keychain_did = keychain::keychain_did::from_keychain(my_keychain);
See Also
-
did - Base DID class
-
persona_did - Persona DID combining two keychain DIDs
-
keychain - Keychain class
-
keychain_type - Keychain type enumeration