Beispiel #1
0
    public RklResponse GetKeys(RklRequest rklRequest)
    {
        Ensure.IsNotNull(rklRequest, nameof(rklRequest));

        var response = _rklServiceRuntime.Run(
            rklRequest,
            _hostname,
            _port,
            ClientId,
            _logger);

        return(response);
    }
Beispiel #2
0
    public RklResponse Run(
        RklRequest request,
        string hostname,
        int port,
        Guid clientId,
        IHsmLogger logger)
    {
        Ensure.IsNotNull(request, nameof(request));
        Ensure.IsNotNullOrEmpty(hostname, nameof(hostname));
        Ensure.IsNotDefault(port, nameof(port), failureMessage: $"It does not appear that the port number was actually set (port: {port})");
        Ensure.IsNotNull(logger, nameof(logger));

        // these are set here instead of passed in because they are not
        // serializable
        var clientCert  = ApplicationValues.VCClientCertificate;
        var clientCerts = new X509Certificate2Collection(clientCert);

        using (var client = new VCServiceClient(hostname, port, clientCerts, clientId, logger))
        {
            var response = client.RetrieveDeviceKeys(request);
            return(response);
        }
    }