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