Ejemplo n.º 1
0
        public override void SaveCredentials(RegistrationOperationStatus operation)
        {
            if (operation?.RegistrationState?.Tpm?.AuthenticationKey == null)
            {
                if (Logging.IsEnabled)
                {
                    Logging.Error(
                        this,
                        $"Authentication key not found. OperationId=${operation?.OperationId}");
                }

                throw new ProvisioningTransportException(
                          "Authentication key not found.",
                          false,
                          operation?.OperationId,
                          null);
            }

            byte[] key = Convert.FromBase64String(operation.RegistrationState.Tpm.AuthenticationKey);
            if (Logging.IsEnabled)
            {
                Logging.DumpBuffer(this, key, nameof(operation.RegistrationState.Tpm.AuthenticationKey));
            }

            _security.ActivateSymmetricIdentity(key);
        }
Ejemplo n.º 2
0
 internal static string ExtractServiceAuthKey(SecurityClientHsmTpm securityClient, string hostName, byte[] activation)
 {
     securityClient.ActivateSymmetricIdentity(activation);
     return(BuildSasSignature(securityClient, KeyName, hostName, TimeToLive));
 }
Ejemplo n.º 3
0
 private string ExtractServiceAuthKey(string hostName, string authenticationKey)
 {
     _securityClient.ActivateSymmetricIdentity(Convert.FromBase64String(authenticationKey));
     return(BuildSasSignature(KeyName, hostName, _timeToLive));
 }