Legrand / Raritan / Server Technology Xerus™ JSON-RPC API
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 /** key-pair generation error codes */
18 constant int ERR_GEN_KEY_LEN_INVALID = 100;
19 constant int ERR_GEN_CSR_OR_CERT_PENDING = 101;
20 constant int ERR_GEN_KEY_GEN_FAILED = 102;
21 constant int ERR_GEN_KEY_TYPE_INVALID = 103;
22 constant int ERR_GEN_ELLIPTIC_CURVE_INVALID = 104;
23
24 /** key-pair installation error codes */
25 constant int ERR_INSTALL_KEY_MISSING = 200;
26 constant int ERR_INSTALL_CERT_MISSING = 201;
27 constant int ERR_INSTALL_CERT_FORMAT_INVALID = 202;
28 constant int ERR_INSTALL_CERT_KEY_MISMATCH = 203;
29 constant int ERR_INSTALL_KEY_FORMAT_INVALID = 204;
30
31 /** Certificate issuer or subject attributes */
32 structure CommonAttributes {
33 string country; ///< Country code
34 string stateOrProvince; ///< State or province
35 string locality; ///< Locality or city
36 string organization; ///< Organization
37 string organizationalUnit; ///< Organizational Unit
38 string commonName; ///< Common Name
39 string emailAddress; ///< Email Address
40 };
41
42 /** Supported key types */
43 enumeration KeyType {
44 KEY_TYPE_UNKNOWN, ///< Key type unknown (only allowed as return value)
45 KEY_TYPE_RSA, ///< RSA key
46 KEY_TYPE_ECDSA ///< ECDSA key
47 };
48
49 /** Supported elliptic curves for key type ECDSA */
50 enumeration EllipticCurve {
51 EC_CURVE_UNKNOWN, ///< Curve unknown (only allowed as return value)
52 EC_CURVE_NIST_P256, ///< NIST curve P-256 (also known as secp256r1 and prime256v1)
53 EC_CURVE_NIST_P384, ///< NIST curve P-384 (also known as secp384r1)
54 EC_CURVE_NIST_P521 ///< NIST curve P-521 (also known as secp521r1)
55 };
56
57 /**
58 * Certificate signing request information
59 *
60 * If names is empty then commonName from the subject is used as single entry.
61 */
62 structure ReqInfo {
63 CommonAttributes subject; ///< Certificate subject attributes
64 vector<string> names; ///< DNS names and/or IP addresses
65 KeyType keyType; ///< Key type
66 EllipticCurve ellipticCurve;///< Selected elliptic curve (only relevant if key type is ECDSA)
67 int rsaKeyLength; ///< Length of the RSA key in bits (only relevant if key type is RSA)
68 };
69
70 /** Certificate information */
71 structure CertInfo {
72 CommonAttributes subject; ///< Subject attributes
73 CommonAttributes issuer; ///< Issuer attributes
74 vector<string> names; ///< DNS names and/or IP addresses
75 string invalidBefore; ///< Begin of validity period
76 string invalidAfter; ///< End of validity period
77 string serialNumber; ///< Serial number
78 KeyType keyType; ///< Key type
79 EllipticCurve ellipticCurve;///< Selected elliptic curve (only relevant if key type is ECDSA)
80 int rsaKeyLength; ///< Length of the RSA key in bits (only relevant if key type is RSA)
81 };
82
83 /** Certificate manager information */
84 structure Info {
85 boolean havePendingReq; ///< \c true if a CSR is pending
86 boolean havePendingCert; ///< \c true if an uploaded certificate is pending activation
87 ReqInfo pendingReqInfo; ///< Information about pending CSR
88 CertInfo pendingCertInfo; ///< Information about pending certificate file (device certificate)
89 vector<CertInfo> pendingCertChainInfos; ///< Information about pending certificate file (remaining certificate chain if available)
90 CertInfo activeCertInfo; ///< Information about active certificate file (device certificate)
91 vector<CertInfo> activeCertChainInfos; ///< Information about active certificate file (remaining certificate chain if available)
92 int maxSignDays; ///< Maximum number of days a self signed certificate will be valid.
93 };
94
95 /**
96 * Generate an unsigned key pair.
97 *
98 * @param reqInfo Certificate signing request information
99 * @param challenge Challenge password
100 *
101 * @return SUCCESS or one of the error code constants
102 */
103 int generateUnsignedKeyPair(in ReqInfo reqInfo, in string challenge);
104
105 /**
106 * Generate a self-signed key pair.
107 *
108 * @param reqInfo Certificate signing request information
109 * @param days Number of days the certificate will be valid
110 *
111 * @return SUCCESS or one of the error code constants
112 */
113 int generateSelfSignedKeyPair(in ReqInfo reqInfo, in int days);
114
115 /**
116 * Remove a pending certificate signing request or certificate.
117 */
119
120 /**
121 * Retrieve certificate manager information.
122 *
123 * @param info Result: Certificate manager information
124 */
125 void getInfo(out Info info);
126
127 /**
128 * Activate a pending key pair.
129 *
130 * @return SUCCESS or one of the error code constants
131 */
133
134 };
135
136}
TLS certificate management interface.
KeyType
Supported key types.
@ KEY_TYPE_UNKNOWN
Key type unknown (only allowed as return value)
void deletePending()
Remove a pending certificate signing request or certificate.
int generateSelfSignedKeyPair(in ReqInfo reqInfo, in int days)
Generate a self-signed key pair.
EllipticCurve
Supported elliptic curves for key type ECDSA.
@ EC_CURVE_NIST_P256
NIST curve P-256 (also known as secp256r1 and prime256v1)
@ EC_CURVE_NIST_P384
NIST curve P-384 (also known as secp384r1)
@ EC_CURVE_UNKNOWN
Curve unknown (only allowed as return value)
int installPendingKeyPair()
Activate a pending key pair.
void getInfo(out Info info)
Retrieve certificate manager information.
int generateUnsignedKeyPair(in ReqInfo reqInfo, in string challenge)
Generate an unsigned key pair.
TLS Certificate Management.
Certificate information.
int rsaKeyLength
Length of the RSA key in bits (only relevant if key type is RSA)
vector< string > names
DNS names and/or IP addresses.
string invalidAfter
End of validity period.
string serialNumber
Serial number.
CommonAttributes issuer
Issuer attributes.
EllipticCurve ellipticCurve
Selected elliptic curve (only relevant if key type is ECDSA)
CommonAttributes subject
Subject attributes.
string invalidBefore
Begin of validity period.
Certificate issuer or subject attributes.
string stateOrProvince
State or province.
string organizationalUnit
Organizational Unit.
Certificate manager information.
boolean havePendingCert
true if an uploaded certificate is pending activation
boolean havePendingReq
true if a CSR is pending
CertInfo activeCertInfo
Information about active certificate file (device certificate)
ReqInfo pendingReqInfo
Information about pending CSR.
int maxSignDays
Maximum number of days a self signed certificate will be valid.
vector< CertInfo > pendingCertChainInfos
Information about pending certificate file (remaining certificate chain if available)
CertInfo pendingCertInfo
Information about pending certificate file (device certificate)
vector< CertInfo > activeCertChainInfos
Information about active certificate file (remaining certificate chain if available)
Certificate signing request information.
EllipticCurve ellipticCurve
Selected elliptic curve (only relevant if key type is ECDSA)
int rsaKeyLength
Length of the RSA key in bits (only relevant if key type is RSA)
vector< string > names
DNS names and/or IP addresses.
CommonAttributes subject
Certificate subject attributes.