Raritan / Server Technology Xerus™ PDU JSON-RPC API
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  */
9 module 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.
Definition: ServerSSLCert.idl:12
KeyType
Supported key types.
Definition: ServerSSLCert.idl:43
@ KEY_TYPE_RSA
RSA key.
Definition: ServerSSLCert.idl:45
@ KEY_TYPE_UNKNOWN
Key type unknown (only allowed as return value)
Definition: ServerSSLCert.idl:44
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.
Definition: ServerSSLCert.idl:50
@ EC_CURVE_NIST_P256
NIST curve P-256 (also known as secp256r1 and prime256v1)
Definition: ServerSSLCert.idl:52
@ EC_CURVE_NIST_P384
NIST curve P-384 (also known as secp384r1)
Definition: ServerSSLCert.idl:53
@ EC_CURVE_UNKNOWN
Curve unknown (only allowed as return value)
Definition: ServerSSLCert.idl:51
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.
Definition: ServerSSLCert.idl:9
Certificate information.
Definition: ServerSSLCert.idl:71
int rsaKeyLength
Length of the RSA key in bits (only relevant if key type is RSA)
Definition: ServerSSLCert.idl:80
KeyType keyType
Key type.
Definition: ServerSSLCert.idl:78
vector< string > names
DNS names and/or IP addresses.
Definition: ServerSSLCert.idl:74
string invalidAfter
End of validity period.
Definition: ServerSSLCert.idl:76
string serialNumber
Serial number.
Definition: ServerSSLCert.idl:77
CommonAttributes issuer
Issuer attributes.
Definition: ServerSSLCert.idl:73
EllipticCurve ellipticCurve
Selected elliptic curve (only relevant if key type is ECDSA)
Definition: ServerSSLCert.idl:79
CommonAttributes subject
Subject attributes.
Definition: ServerSSLCert.idl:72
string invalidBefore
Begin of validity period.
Definition: ServerSSLCert.idl:75
Certificate issuer or subject attributes.
Definition: ServerSSLCert.idl:32
string organization
Organization.
Definition: ServerSSLCert.idl:36
string emailAddress
Email Address.
Definition: ServerSSLCert.idl:39
string country
Country code.
Definition: ServerSSLCert.idl:33
string stateOrProvince
State or province.
Definition: ServerSSLCert.idl:34
string commonName
Common Name.
Definition: ServerSSLCert.idl:38
string locality
Locality or city.
Definition: ServerSSLCert.idl:35
string organizationalUnit
Organizational Unit.
Definition: ServerSSLCert.idl:37
Certificate manager information.
Definition: ServerSSLCert.idl:84
boolean havePendingCert
true if an uploaded certificate is pending activation
Definition: ServerSSLCert.idl:86
boolean havePendingReq
true if a CSR is pending
Definition: ServerSSLCert.idl:85
CertInfo activeCertInfo
Information about active certificate file (device certificate)
Definition: ServerSSLCert.idl:90
ReqInfo pendingReqInfo
Information about pending CSR.
Definition: ServerSSLCert.idl:87
int maxSignDays
Maximum number of days a self signed certificate will be valid.
Definition: ServerSSLCert.idl:92
vector< CertInfo > pendingCertChainInfos
Information about pending certificate file (remaining certificate chain if available)
Definition: ServerSSLCert.idl:89
CertInfo pendingCertInfo
Information about pending certificate file (device certificate)
Definition: ServerSSLCert.idl:88
vector< CertInfo > activeCertChainInfos
Information about active certificate file (remaining certificate chain if available)
Definition: ServerSSLCert.idl:91
Certificate signing request information.
Definition: ServerSSLCert.idl:62
KeyType keyType
Key type.
Definition: ServerSSLCert.idl:65
EllipticCurve ellipticCurve
Selected elliptic curve (only relevant if key type is ECDSA)
Definition: ServerSSLCert.idl:66
int rsaKeyLength
Length of the RSA key in bits (only relevant if key type is RSA)
Definition: ServerSSLCert.idl:67
vector< string > names
DNS names and/or IP addresses.
Definition: ServerSSLCert.idl:64
CommonAttributes subject
Certificate subject attributes.
Definition: ServerSSLCert.idl:63