Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
PKI/PrivateKey.h
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#ifndef _Stroika_Foundation_Cryptography_PrivateKey_h_
5#define _Stroika_Foundation_Cryptography_PrivateKey_h_ 1
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
9#include <memory>
10
12#include "Stroika/Foundation/Common/Common.h"
14
15namespace Stroika::Foundation::Cryptography::PKI::PrivateKey {
16
17 using Characters::String;
18 using Memory::BLOB;
19
20 /**
21 */
22 class IRep {
23 public:
24 virtual ~IRep () = default;
25
26 // @todo type notion not super useful like this
27 virtual int GetType () const = 0;
28 virtual unsigned int GetBits () const = 0;
29 virtual String GetPrintSummary () const = 0;
30 };
31
32 /**
33 */
34 struct Ptr : shared_ptr<IRep> {
35 using inherited = shared_ptr<IRep>;
36 /**
37 */
38 using inherited::inherited;
39
40 Characters::String ToString () const;
41
42 int GetType () const
43 {
44 return get ()->GetType ();
45 }
46 // the cryptographic length of the cryptosystem to which the key in pkey belongs, in bits
47 unsigned int GetBits () const
48 {
49 return get ()->GetBits ();
50 }
51 String GetPrintSummary () const
52 {
53 return get ()->GetPrintSummary ();
54 }
55 };
56
57#if 0
58 // Probably no useful CTOR of this type - must have 'type' and possibly extra params for that type and construct subtypes.
59 /**
60 * \brief Create a PrivateKey (for now just from a PEM file)
61 */
62 //Ptr New (const PEMFile& pem);
63#endif
64
65}
66
67/*
68 ********************************************************************************
69 ***************************** Implementation Details ***************************
70 ********************************************************************************
71 */
72
73#endif /*_Stroika_Foundation_Cryptography_PrivateKey_h_*/
STRING_TYPE ToString(FLOAT_TYPE f, const ToStringOptions &options={})