All Classes Files Functions Variables Enumerations Enumerator Groups Pages
kerio::web::Certificates Interface Reference

import "Certificates.idl";

Public Member Functions

void get (out CertificateList certificates, out long totalItems, in SearchQuery query)
void setName (in KId id, in string name)
void remove (out ErrorList errors, in KIdList ids)
void generate (out KId id, in NamedValueList subject, in string name, in CertificateType type, in ValidPeriod period)
void getCountryList (out NamedValueList countries)
void importCertificate (out KId id, in KId keyId, in string fileId, in string name, in CertificateType type)
void importPrivateKey (out KId keyId, out boolean needPassword, in string fileId)
void unlockPrivateKey (in KId keyId, in string password)
void exportCertificate (out Download fileDownload, in KId id)
void exportPrivateKey (out Download fileDownload, in KId id)
void toSource (out string source, in KId id)

Detailed Description

Manager of Certificates

Member Function Documentation

void kerio::web::Certificates::exportCertificate ( out Download  fileDownload,
in KId  id 
)

Export of certificate or certificate request Note: "export" is a keyword in C++, so name of the method must be changed: exportCertificate

Parameters
fileDownload- description of the output file
id- ID of the certificate or certificate request
Exceptions
kerio::web::ApiExceptionon error: -32001 Session expired. - "The user is not logged in." 1000 OperationFailed. - "Unable to export certificate." 1002 No such entity. - "Unable to find certificate." 1004 Access denied. - "Insufficient rights to perform the requested operation."
void kerio::web::Certificates::exportPrivateKey ( out Download  fileDownload,
in KId  id 
)

Export of certificate or request privatekey Note: "export" is a keyword in C++, so the name of the method must be changed: exportPrivateKey

Parameters
fileDownload- description of the output file
id- ID of the certificate or certificate request
Exceptions
kerio::web::ApiExceptionon error: -32001 Session expired. - "The user is not logged in." 1000 OperationFailed. - "Unable to export certificate." 1002 No such entity. - "Unable to find certificate." 1004 Access denied. - "Insufficient rights to perform the requested operation."
void kerio::web::Certificates::generate ( out KId  id,
in NamedValueList  subject,
in string  name,
in CertificateType  type,
in ValidPeriod  period 
)

Generate certificate.

See Also
Control team has generateEx(), which supports subjectAltNames (unity).
Parameters
id- ID of generated certificate
subject- properties specified by user
name- name of the new certificate
type- type of certificate to be generated, valid input is one of: InactiveCertificate/CertificateRequest/LocalAuthority
period- time properties specified by user, not relevant for CertificateRequest
Exceptions
kerio::web::ApiExceptionon error: -32001 Session expired. - "The user is not logged in." 1004 Access denied. - "Insufficient rights to perform the requested operation." Invalid params. - "Unable to generate certificate, expiration date has already passed." Invalid params. - "Unable to generate certificate, properties are invalid."
void kerio::web::Certificates::get ( out CertificateList  certificates,
out long  totalItems,
in SearchQuery  query 
)

Obtain a list of certificates

Parameters
certificates- current list of certificates
totalItems- count of all services on server (before the start/limit applied)
query- conditions and limits. Included from weblib.
Exceptions
kerio::web::ApiExceptionon error: -32001 Session expired. - "The user is not logged in." 1004 Access denied. - "Insufficient rights to perform the requested operation."
void kerio::web::Certificates::getCountryList ( out NamedValueList  countries)

Get a list of countries.

Parameters
countries- list of countries (name and ISO 3166 code)
Exceptions
kerio::web::ApiExceptionon error: -32001 Session expired. - "The user is not logged in." 1004 Access denied. - "Insufficient rights to perform the requested operation."
void kerio::web::Certificates::importCertificate ( out KId  id,
in KId  keyId,
in string  fileId,
in string  name,
in CertificateType  type 
)

Import certificate in PEM format

Parameters
id- ID of generated certificate
keyId- ID assigned to imported private key,
See Also
importPrivateKey
Parameters
fileId- id of uploaded file
name- name of the new certificate
type- type of certificate to be imported, valid input is one of: InactiveCertificate/Authority/LocalAuthority
Exceptions
kerio::web::ApiExceptionon error: -32001 Session expired. - "The user is not logged in." 1000 OperationFailed. - "Unable to import certificate, certificate already imported." 1000 OperationFailed. - "Unable to import certificate, key is not valid for imported certificate." 1000 OperationFailed. - "Unable to import certificate, it's not a Certificate Authority." 1002 No such entity. - "Unable to import certificate, key not found." 1004 Access denied. - "Insufficient rights to perform the requested operation." Invalid params. - "Unable to import certificate, the content is invalid."
void kerio::web::Certificates::importPrivateKey ( out KId  keyId,
out boolean  needPassword,
in string  fileId 
)

Import private key. It generates ID, so it can be linked to Certificate content imported later,

See Also
importCertificate
Parameters
keyId- generated ID for new key
needPassword- true if private key is encrypted with password
fileId- id of uploaded file
Exceptions
kerio::web::ApiExceptionon error: -32001 Session expired. - "The user is not logged in." 1002 No such entity. - "Uploaded file does not exist." 1004 Access denied. - "Insufficient rights to perform the requested operation." Invalid params. - "Unable to import private key, content is invalid."
void kerio::web::Certificates::remove ( out ErrorList  errors,
in KIdList  ids 
)

Remove list of certificate records

Parameters
errors- error message list
ids- list of identifiers of deleted user templates
Exceptions
kerio::web::ApiExceptionon error: -32001 Session expired. - "The user is not logged in." 1002 No such entity. - "Certificate not found." 1004 Access denied. - "Insufficient rights to perform the requested operation."
void kerio::web::Certificates::setName ( in KId  id,
in string  name 
)

Renames certificate

Parameters
id- ID of certificate to rename
name- new name of the certificate
Exceptions
kerio::web::ApiExceptionon error: -32001 Session expired. - "The user is not logged in." 1002 No such entity. - "Unable to find certificate." 1004 Access denied. - "Insufficient rights to perform the requested operation."
void kerio::web::Certificates::toSource ( out string  source,
in KId  id 
)

Obtain source (plain-text representation) of the certificate

Parameters
source- certificate in plain text
id- global identifier
Exceptions
kerio::web::ApiExceptionon error: -32001 Session expired. - "The user is not logged in." 1002 No such entity. - "Unable to find certificate." 1004 Access denied. - "Insufficient rights to perform the requested operation."
void kerio::web::Certificates::unlockPrivateKey ( in KId  keyId,
in string  password 
)

Try to parse imported private key. Need to be called, when returns needPassword == true.

Parameters
keyId- ID assigned to imported private key,
See Also
importPrivateKey
Parameters
password- certificate password
Exceptions
kerio::web::ApiExceptionon error: -32001 Session expired. - "The user is not logged in." 1000 OperationFailed. - "Unable to import certificate, key already decrypted." 1000 OperationFailed. - "Unable to import certificate, password is not valid." 1004 Access denied. - "Insufficient rights to perform the requested operation." Invalid params. - "Unable to parse private key with given password!"

The documentation for this interface was generated from the following file: