Legrand / Raritan Xerus™ JSON-RPC API for Remote Access Devices like KX4-101, KX3G2

Loading...
Searching...
No Matches
ServerSSLCert.idl
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Copyright 2010 Raritan Inc. All rights reserved.
4 */
5
6/**
7 * TLS Certificate Management
8 */
9module cert {
10
11 /** TLS certificate management interface */
12 interface ServerSSLCert {
13
14 /** success code */
15 constant int SUCCESS = 0;
16
17 /** shared error codes */
18 constant int ERR_BUSY = 1;
19 constant int ERR_CSR_OR_CERT_PENDING = 101;
20 constant int ERR_KEY_MISSING = 200;
21 constant int ERR_CERT_MISSING = 201;
22 constant int ERR_CERT_FORMAT_INVALID = 202;
23 constant int ERR_CERT_KEY_MISMATCH = 203;
24 constant int ERR_KEY_FORMAT_INVALID = 204;
25
26 /** key-pair generation specific error codes */
27 constant int ERR_GEN_KEY_LEN_INVALID = 100;
28 constant int ERR_GEN_CSR_OR_CERT_PENDING = 101; ///< same as ERR_CSR_OR_CERT_PENDING
29 constant int ERR_GEN_KEY_GEN_FAILED = 102;
30 constant int ERR_GEN_KEY_TYPE_INVALID = 103;
31 constant int ERR_GEN_ELLIPTIC_CURVE_INVALID = 104;
32 constant int ERR_GEN_VALIDITY_OUT_OF_RANGE = 105;
33
34 /** key-pair installation specific error codes (backward compatibility) */
35 constant int ERR_INSTALL_KEY_MISSING = 200; ///< same as ERR_KEY_MISSING
36 constant int ERR_INSTALL_CERT_MISSING = 201; ///< same as ERR_CERT_MISSING
37 constant int ERR_INSTALL_CERT_FORMAT_INVALID = 202; ///< same as ERR_CERT_FORMAT_INVALID
38 constant int ERR_INSTALL_CERT_KEY_MISMATCH = 203; ///< same as ERR_CERT_KEY_MISMATCH
39 constant int ERR_INSTALL_KEY_FORMAT_INVALID = 204; ///> same as ERR_KEY_FORMAT_INVALID
40
41 /** Certificate issuer or subject attributes */
42 structure CommonAttributes {
43 string country; ///< Country code
44 string stateOrProvince; ///< State or province
45 string locality; ///< Locality or city
46 string organization; ///< Organization
47 string organizationalUnit; ///< Organizational Unit
48 string commonName; ///< Common Name
49 string emailAddress; ///< Email Address
50 };
51
52 /** Supported key types */
53 enumeration KeyType {
54 KEY_TYPE_UNKNOWN, ///< Key type unknown (only allowed as return value)
55 KEY_TYPE_RSA, ///< RSA key
56 KEY_TYPE_ECDSA ///< ECDSA key
57 };
58
59 /** Supported elliptic curves for key type ECDSA */
60 enumeration EllipticCurve {
61 EC_CURVE_UNKNOWN, ///< Curve unknown (only allowed as return value)
62 EC_CURVE_NIST_P256, ///< NIST curve P-256 (also known as secp256r1 and prime256v1)
63 EC_CURVE_NIST_P384, ///< NIST curve P-384 (also known as secp384r1)
64 EC_CURVE_NIST_P521 ///< NIST curve P-521 (also known as secp521r1)
65 };
66
67 /** Public key information */
68 structure KeyInfo {
69 KeyType type; ///< Key type
70 EllipticCurve ecCurve; ///< Selected elliptic curve (only relevant if key type is ECDSA)
71 int rsaKeyLength; ///< Length of the RSA key in bits (only relevant if key type is RSA)
72 boolean inSecureElement; ///< \c true if located in a Secure Element
73 };
74
75 /**
76 * Certificate signing request information
77 *
78 * If names is empty then commonName from the subject is used as single entry.
79 */
80 structure ReqInfo {
81 CommonAttributes subject; ///< Certificate subject attributes
82 vector<string> names; ///< DNS names and/or IP addresses
83 KeyInfo keyInfo; ///< Key information
84 };
85
86 /** Certificate information */
87 structure CertInfo {
88 CommonAttributes subject; ///< Subject attributes
89 CommonAttributes issuer; ///< Issuer attributes
90 vector<string> names; ///< DNS names and/or IP addresses
91 string invalidBefore; ///< Begin of validity period
92 string invalidAfter; ///< End of validity period
93 string serialNumber; ///< Serial number
94 KeyInfo keyInfo; ///< Key information
95 };
96
97 /** Certificate manager information */
98 structure Info {
99 boolean havePendingReq; ///< \c true if a CSR is pending
100 boolean havePendingCert; ///< \c true if an uploaded certificate is pending activation
101 ReqInfo pendingReqInfo; ///< Information about pending CSR
102 CertInfo pendingCertInfo; ///< Information about pending certificate file (device certificate)
103 vector<CertInfo> pendingCertChainInfos; ///< Information about pending certificate file (remaining certificate chain if available)
104 CertInfo activeCertInfo; ///< Information about active certificate file (device certificate)
105 vector<CertInfo> activeCertChainInfos; ///< Information about active certificate file (remaining certificate chain if available)
106 int maxSignDays; ///< Maximum number of days a self signed certificate will be valid.
107 };
108
109 /**
110 * Get all supported key variants.
111 *
112 * @return Vector of KeyInfo structures representing all supported key variants
113 */
114 vector<KeyInfo> getSupportedKeyInfos();
115
116 /**
117 * Generate an unsigned key pair.
118 *
119 * @param reqInfo Certificate signing request information
120 * @param challenge Challenge password
121 *
122 * @return SUCCESS or one of the error code constants
123 */
124 int generateUnsignedKeyPair(in ReqInfo reqInfo, in string challenge);
125
126 /**
127 * Generate a self-signed key pair.
128 *
129 * @param reqInfo Certificate signing request information
130 * @param days Number of days the certificate will be valid
131 *
132 * @return SUCCESS or one of the error code constants
133 */
134 int generateSelfSignedKeyPair(in ReqInfo reqInfo, in int days);
135
136 /**
137 * Remove pending key and certificate signing request or certificate.
138 */
139 void deletePending();
140
141 /**
142 * Retrieve certificate manager information.
143 *
144 * @param info Result: Certificate manager information
145 */
146 void getInfo(out Info info);
147
148 /**
149 * Get the active cert chain in PEM format.
150 *
151 * Currently not available via JSON-RPC.
152 *
153 * @return Cert chain in PEM format.
154 */
155 string getActiveCertChainPEM();
156
157 /**
158 * Get the active private key in PEM format.
159 *
160 * Currently not available via JSON-RPC.
161 *
162 * @param keyPassword Password to encrypt the returned key (currently not used)
163 *
164 * @return The private key in PEM format.
165 */
166 string getActiveKeyPEM(in string keyPassword);
167
168 /**
169 * Get the pending cert signing request (CSR) in PEM format.
170 *
171 * Currently not available via JSON-RPC.
172 *
173 * @return Cert signing request in PEM format.
174 */
175 string getPendingRequestPEM();
176
177 /**
178 * Get the pending cert chain in PEM format.
179 *
180 * Currently not available via JSON-RPC.
181 *
182 * @return Cert chain in PEM format.
183 */
184 string getPendingCertChainPEM();
185
186 /**
187 * Get the pending private key in PEM format.
188 *
189 * Currently not available via JSON-RPC.
190 *
191 * @param keyPassword Password to encrypt the returned key (currently not used)
192 *
193 * @return The private key in PEM format.
194 */
195 string getPendingKeyPEM(in string keyPassword);
196
197 /**
198 * Set the pending cert chain in PEM format.
199 *
200 * Currently not available via JSON-RPC.
201 *
202 * @param certChain Cert chain in PEM format.
203 *
204 * @return SUCCESS or one of the error code constants
205 */
206 int setPendingCertChainPEM(in string certChain);
207
208 /**
209 * Set the pending private key and cert chain in PEM format.
210 *
211 * Currently not available via JSON-RPC.
212 *
213 * @param key Private key in PEM format.
214 * @param certChain Cert chain in PEM format.
215 * @param keyPassword Password to decrypt the private key (currently not used)
216 *
217 * @return SUCCESS or one of the error code constants
218 */
219 int setPendingKeyAndCertChainPEM(in string key, in string certChain, in string keyPassword);
220
221 /**
222 * Activate a pending key pair.
223 *
224 * @return SUCCESS or one of the error code constants
225 */
226 int installPendingKeyPair();
227
228 };
229
230}
cert::ServerSSLCert
TLS certificate management interface.
Definition ServerSSLCert.idl:12
cert::ServerSSLCert::KeyType
KeyType
Supported key types.
Definition ServerSSLCert.idl:53
cert::ServerSSLCert::KEY_TYPE_RSA
@ KEY_TYPE_RSA
RSA key.
Definition ServerSSLCert.idl:55
cert::ServerSSLCert::KEY_TYPE_UNKNOWN
@ KEY_TYPE_UNKNOWN
Key type unknown (only allowed as return value)
Definition ServerSSLCert.idl:54
cert::ServerSSLCert::KEY_TYPE_ECDSA
@ KEY_TYPE_ECDSA
ECDSA key.
Definition ServerSSLCert.idl:56
cert::ServerSSLCert::getSupportedKeyInfos
vector< KeyInfo > getSupportedKeyInfos()
Get all supported key variants.
cert::ServerSSLCert::deletePending
void deletePending()
Remove pending key and certificate signing request or certificate.
cert::ServerSSLCert::ERR_BUSY
constant int ERR_BUSY
shared error codes
Definition ServerSSLCert.idl:18
cert::ServerSSLCert::generateSelfSignedKeyPair
int generateSelfSignedKeyPair(in ReqInfo reqInfo, in int days)
Generate a self-signed key pair.
cert::ServerSSLCert::setPendingKeyAndCertChainPEM
int setPendingKeyAndCertChainPEM(in string key, in string certChain, in string keyPassword)
Set the pending private key and cert chain in PEM format.
cert::ServerSSLCert::EllipticCurve
EllipticCurve
Supported elliptic curves for key type ECDSA.
Definition ServerSSLCert.idl:60
cert::ServerSSLCert::EC_CURVE_NIST_P256
@ EC_CURVE_NIST_P256
NIST curve P-256 (also known as secp256r1 and prime256v1)
Definition ServerSSLCert.idl:62
cert::ServerSSLCert::EC_CURVE_NIST_P384
@ EC_CURVE_NIST_P384
NIST curve P-384 (also known as secp384r1)
Definition ServerSSLCert.idl:63
cert::ServerSSLCert::EC_CURVE_UNKNOWN
@ EC_CURVE_UNKNOWN
Curve unknown (only allowed as return value)
Definition ServerSSLCert.idl:61
cert::ServerSSLCert::EC_CURVE_NIST_P521
@ EC_CURVE_NIST_P521
NIST curve P-521 (also known as secp521r1)
Definition ServerSSLCert.idl:64
cert::ServerSSLCert::getActiveCertChainPEM
string getActiveCertChainPEM()
Get the active cert chain in PEM format.
cert::ServerSSLCert::ERR_GEN_CSR_OR_CERT_PENDING
constant int ERR_GEN_CSR_OR_CERT_PENDING
same as ERR_CSR_OR_CERT_PENDING
Definition ServerSSLCert.idl:28
cert::ServerSSLCert::getPendingCertChainPEM
string getPendingCertChainPEM()
Get the pending cert chain in PEM format.
cert::ServerSSLCert::getActiveKeyPEM
string getActiveKeyPEM(in string keyPassword)
Get the active private key in PEM format.
cert::ServerSSLCert::installPendingKeyPair
int installPendingKeyPair()
Activate a pending key pair.
cert::ServerSSLCert::getPendingKeyPEM
string getPendingKeyPEM(in string keyPassword)
Get the pending private key in PEM format.
cert::ServerSSLCert::ERR_INSTALL_CERT_MISSING
constant int ERR_INSTALL_CERT_MISSING
same as ERR_CERT_MISSING
Definition ServerSSLCert.idl:36
cert::ServerSSLCert::ERR_GEN_KEY_LEN_INVALID
constant int ERR_GEN_KEY_LEN_INVALID
key-pair generation specific error codes
Definition ServerSSLCert.idl:27
cert::ServerSSLCert::setPendingCertChainPEM
int setPendingCertChainPEM(in string certChain)
Set the pending cert chain in PEM format.
cert::ServerSSLCert::ERR_INSTALL_KEY_MISSING
constant int ERR_INSTALL_KEY_MISSING
key-pair installation specific error codes (backward compatibility)
Definition ServerSSLCert.idl:35
cert::ServerSSLCert::getInfo
void getInfo(out Info info)
Retrieve certificate manager information.
cert::ServerSSLCert::getPendingRequestPEM
string getPendingRequestPEM()
Get the pending cert signing request (CSR) in PEM format.
cert::ServerSSLCert::ERR_INSTALL_CERT_FORMAT_INVALID
constant int ERR_INSTALL_CERT_FORMAT_INVALID
same as ERR_CERT_FORMAT_INVALID
Definition ServerSSLCert.idl:37
cert::ServerSSLCert::ERR_INSTALL_CERT_KEY_MISMATCH
constant int ERR_INSTALL_CERT_KEY_MISMATCH
same as ERR_CERT_KEY_MISMATCH
Definition ServerSSLCert.idl:38
cert::ServerSSLCert::SUCCESS
constant int SUCCESS
success code
Definition ServerSSLCert.idl:15
cert::ServerSSLCert::generateUnsignedKeyPair
int generateUnsignedKeyPair(in ReqInfo reqInfo, in string challenge)
Generate an unsigned key pair.
cert
TLS Certificate Management.
Definition ServerSSLCert.idl:9
cert::ServerSSLCert::CertInfo
Certificate information.
Definition ServerSSLCert.idl:87
cert::ServerSSLCert::CertInfo::names
vector< string > names
DNS names and/or IP addresses.
Definition ServerSSLCert.idl:90
cert::ServerSSLCert::CertInfo::invalidAfter
string invalidAfter
End of validity period.
Definition ServerSSLCert.idl:92
cert::ServerSSLCert::CertInfo::keyInfo
KeyInfo keyInfo
Key information.
Definition ServerSSLCert.idl:94
cert::ServerSSLCert::CertInfo::serialNumber
string serialNumber
Serial number.
Definition ServerSSLCert.idl:93
cert::ServerSSLCert::CertInfo::issuer
CommonAttributes issuer
Issuer attributes.
Definition ServerSSLCert.idl:89
cert::ServerSSLCert::CertInfo::subject
CommonAttributes subject
Subject attributes.
Definition ServerSSLCert.idl:88
cert::ServerSSLCert::CertInfo::invalidBefore
string invalidBefore
Begin of validity period.
Definition ServerSSLCert.idl:91
cert::ServerSSLCert::CommonAttributes
Certificate issuer or subject attributes.
Definition ServerSSLCert.idl:42
cert::ServerSSLCert::CommonAttributes::organization
string organization
Organization.
Definition ServerSSLCert.idl:46
cert::ServerSSLCert::CommonAttributes::emailAddress
string emailAddress
Email Address.
Definition ServerSSLCert.idl:49
cert::ServerSSLCert::CommonAttributes::country
string country
Country code.
Definition ServerSSLCert.idl:43
cert::ServerSSLCert::CommonAttributes::stateOrProvince
string stateOrProvince
State or province.
Definition ServerSSLCert.idl:44
cert::ServerSSLCert::CommonAttributes::commonName
string commonName
Common Name.
Definition ServerSSLCert.idl:48
cert::ServerSSLCert::CommonAttributes::locality
string locality
Locality or city.
Definition ServerSSLCert.idl:45
cert::ServerSSLCert::CommonAttributes::organizationalUnit
string organizationalUnit
Organizational Unit.
Definition ServerSSLCert.idl:47
cert::ServerSSLCert::Info
Certificate manager information.
Definition ServerSSLCert.idl:98
cert::ServerSSLCert::Info::havePendingCert
boolean havePendingCert
true if an uploaded certificate is pending activation
Definition ServerSSLCert.idl:100
cert::ServerSSLCert::Info::havePendingReq
boolean havePendingReq
true if a CSR is pending
Definition ServerSSLCert.idl:99
cert::ServerSSLCert::Info::activeCertInfo
CertInfo activeCertInfo
Information about active certificate file (device certificate)
Definition ServerSSLCert.idl:104
cert::ServerSSLCert::Info::pendingReqInfo
ReqInfo pendingReqInfo
Information about pending CSR.
Definition ServerSSLCert.idl:101
cert::ServerSSLCert::Info::maxSignDays
int maxSignDays
Maximum number of days a self signed certificate will be valid.
Definition ServerSSLCert.idl:106
cert::ServerSSLCert::Info::pendingCertChainInfos
vector< CertInfo > pendingCertChainInfos
Information about pending certificate file (remaining certificate chain if available)
Definition ServerSSLCert.idl:103
cert::ServerSSLCert::Info::pendingCertInfo
CertInfo pendingCertInfo
Information about pending certificate file (device certificate)
Definition ServerSSLCert.idl:102
cert::ServerSSLCert::Info::activeCertChainInfos
vector< CertInfo > activeCertChainInfos
Information about active certificate file (remaining certificate chain if available)
Definition ServerSSLCert.idl:105
cert::ServerSSLCert::KeyInfo
Public key information.
Definition ServerSSLCert.idl:68
cert::ServerSSLCert::KeyInfo::ecCurve
EllipticCurve ecCurve
Selected elliptic curve (only relevant if key type is ECDSA)
Definition ServerSSLCert.idl:70
cert::ServerSSLCert::KeyInfo::type
KeyType type
Key type.
Definition ServerSSLCert.idl:69
cert::ServerSSLCert::KeyInfo::rsaKeyLength
int rsaKeyLength
Length of the RSA key in bits (only relevant if key type is RSA)
Definition ServerSSLCert.idl:71
cert::ServerSSLCert::KeyInfo::inSecureElement
boolean inSecureElement
true if located in a Secure Element
Definition ServerSSLCert.idl:72
cert::ServerSSLCert::ReqInfo
Certificate signing request information.
Definition ServerSSLCert.idl:80
cert::ServerSSLCert::ReqInfo::keyInfo
KeyInfo keyInfo
Key information.
Definition ServerSSLCert.idl:83
cert::ServerSSLCert::ReqInfo::names
vector< string > names
DNS names and/or IP addresses.
Definition ServerSSLCert.idl:82
cert::ServerSSLCert::ReqInfo::subject
CommonAttributes subject
Certificate subject attributes.
Definition ServerSSLCert.idl:81