Search Results for

    Show / Hide Table of Contents

    Method CreateCertificate

    CreateCertificate(String, String, String, StringGlobalContract, String, CertificateSettingsContract)

    Creates a certificate

    Declaration
    CertificateContract CreateCertificate(string connectionId, string fileId, string password, StringGlobalContract name, string description, CertificateSettingsContract certificateSettings)
    Parameters
    Type Name Description
    System.String connectionId

    The connection id to identify your connection. See also ConnectionId

    System.String fileId

    File id to use. See also UploadFileBytes(String, String, Byte[], Int32)

    System.String password

    The password of the certificate (only mandatory for a .pfx certificate)

    StringGlobalContract name

    The name of the certificate

    System.String description

    The description of the certificate

    CertificateSettingsContract certificateSettings

    The certificate settings. See also CertificateSettingsContract

    Returns
    Type Description
    CertificateContract

    The created certificate

    Remarks
    • You need "Access to scheme" access right (01002060-38a7-11d8-a902-0050bf427e8f). See also GetUserAdminAccessRights(String, String)
    • Use only .cer and .pfx certificates
    Examples

    POST http://YourServerName/InfoShare/Json/Common/CreateCertificate

    Example for creating a certificate.

    {
       "connectionId": "5434cf69-24ff-4c95-aa6d-1066cc8f31fd", 
       "fileId": "db93e006-88d1-4838-a245-f5f13b2c4d0b", 
       "password": "xyz123", 
       "name": {
         "Values": [ {
           "Culture": "de",
           "Text": "TestCertificate.pfx" }, {
           "Culture": "en",
           "Text": "TestCertificate.pfx" } ] }, 
       "description": "Test certificate", 
       "certificateSettings": {
         "AllowTokenLoginsAllUsers": true,
         "AllowedUserIdsForLogin": [
           "21f92453-6f45-ed11-a4c9-00155df08701", "c8c89354-6f45-ed11-a4c9-00155df08701" ] }
    }

    Response:

    {
       "CreateCertificateResult": {
         "CertificateSerialNumber": "17FDFCC50EAB6D9640180A67783EB940",
         "CertificateSettings": {
           "AllowTokenLoginsAllUsers": true,
           "AllowedUserIdsForLogin": [
             "21f92453-6f45-ed11-a4c9-00155df08701", "c8c89354-6f45-ed11-a4c9-00155df08701" ] },
         "Description": "Test certificate pfx",
         "Id": "39edbade-a174-ed11-b4d5-00255df00701",
         "IssuedTo": "Hans Muster",
         "Issuer": "CN=TestCertificate",
         "Name": {
           "Values": [ {
             "Culture": "de",
             "Text": "TestCertificate.pfx" }, {
             "Culture": "en",
             "Text": "TestCertificate.pfx" } ] },
         "Thumbprint": "1409093551db49f20d34308ce142bc2b30d6ee51",
         "ValidFrom": "2022-11-25T15:43:23",
         "ValidTo": "2023-11-25T16:03:23" }
    }
    Exceptions
    Type Condition
    ServiceException

    The connection id {connectionId} isn't valid or has expired (10008)

    ServiceException

    Verification code is needed: Verification code not yet verified (10152)

    ServiceException

    Not enough rights ({accessOperationName}, {accessOperationId}) (10071)

    ServiceException

    The administrative context {administrativeContext} is already checked out by user {displayLoginName} (10129)

    Back to top Copyright © Kendox