Exemple #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);
        }
Exemple #2
0
 internal static string ExtractServiceAuthKey(SecurityClientHsmTpm securityClient, string hostName, byte[] activation)
 {
     securityClient.ActivateSymmetricIdentity(activation);
     return(BuildSasSignature(securityClient, KeyName, hostName, TimeToLive));
 }
Exemple #3
0
 private string ExtractServiceAuthKey(string hostName, string authenticationKey)
 {
     _securityClient.ActivateSymmetricIdentity(Convert.FromBase64String(authenticationKey));
     return(BuildSasSignature(KeyName, hostName, _timeToLive));
 }