Class Session

    • Constructor Detail

      • Session

        public Session​(java.net.URI url,
                       HttpClientHandler httpClientHandler)
                throws PermissionException,
                       HttpException
        Parameters:
        url -

        The service endpoint base URL.

        Example: https://ais.swisscom.com

        httpClientHandler - The SSL configuration with the client certificate and trust store. Use pdftools.HttpClientHandler.setClientCertificate to set your SSL client certificate "clientcert.p12" of your Swisscom Signing Service account.
        Throws:
        HttpException - If a network error occurs.
        PermissionException - If the SSL client certificate is rejected.
        java.lang.IllegalArgumentException - if url is null
        java.lang.IllegalArgumentException - if httpClientHandler is null
    • Method Detail

      • createSignatureForStaticIdentity

        public SignatureConfiguration createSignatureForStaticIdentity​(java.lang.String identity,
                                                                       java.lang.String name)

        Create a signature configuration for a static certificate.

        Parameters:
        identity -

        The Claimed Identity string as provided by Swisscom: ‹customer name›:‹key identity›

        Example: "ais-90days-trial:static-saphir4-ch"

        name -

        Name of the signer. This parameter is not used for certificate selection, but for the signature appearance and signature description in the PDF only.

        Example: "Signing Service TEST account"

        Returns:
        Throws:
        java.lang.IllegalArgumentException - if identity is null
        java.lang.IllegalArgumentException - if name is null
      • createSignatureForOnDemandIdentity

        public SignatureConfiguration createSignatureForOnDemandIdentity​(java.lang.String identity,
                                                                         java.lang.String distinguishedName,
                                                                         StepUp stepUp)

        Create a signature configuration for an on-demand certificate

        Parameters:
        identity -

        The Claimed Identity string as provided by Swisscom: ‹customer name›:‹key identity›

        Example: "ais-90days-trial:OnDemand-Advanced4"

        distinguishedName -

        The requested distinguished name of the on-demand certificate.

        Example: "cn=Hans Muster,o=ACME,c=CH"

        stepUp - Options for step-up authorization using Mobile ID.
        Returns:
        Throws:
        java.lang.IllegalArgumentException - if identity is null
        java.lang.IllegalArgumentException - if distinguishedName is null
      • createTimestamp

        public TimestampConfiguration createTimestamp​(java.lang.String identity)

        Create a time-stamp configuration

        Parameters:
        identity -

        The Claimed Identity string as provided by Swisscom: ‹customer name›

        Example: "ais-90days-trial"

        Returns:
        Throws:
        java.lang.IllegalArgumentException - if identity is null