Skip to content

Commit

Permalink
doc(tpm): Add doc comments about TPM exceptions thrown by the client (A…
Browse files Browse the repository at this point in the history
  • Loading branch information
abhipsaMisra authored Apr 20, 2021
1 parent f49d9a4 commit 63ff0a2
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions security/tpm/src/SecurityProviderTpmHsm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,20 @@ public class SecurityProviderTpmHsm : SecurityProviderTpm
/// <summary>
/// Initializes a new instance of the SecurityProviderTpmHsm class using the system TPM.
/// </summary>
/// <remarks>
/// Calls to the TPM library can potentially return a <see cref="TssException"/> or a <see cref="TpmException"/>
/// if your TPM hardware does not support the relevant API call.
/// </remarks>
/// <param name="registrationId">The Device Provisioning Service Registration Id.</param>
public SecurityProviderTpmHsm(string registrationId) : this(registrationId, CreateDefaultTpm2Device()) { }

/// <summary>
/// Initializes a new instance of the SecurityProviderTpmHsm class using the specified TPM module.
/// </summary>
/// <remarks>
/// Calls to the TPM library can potentially return a <see cref="TssException"/> or a <see cref="TpmException"/>
/// if your TPM hardware does not support the relevant API call.
/// </remarks>
/// <param name="registrationId">The Device Provisioning Service Registration Id.</param>
/// <param name="tpm">The TPM device.</param>
public SecurityProviderTpmHsm(string registrationId, Tpm2Device tpm) : base(registrationId)
Expand Down Expand Up @@ -103,6 +111,10 @@ private static Tpm2Device CreateDefaultTpm2Device()
/// <summary>
/// Activates an identity key within the TPM device.
/// </summary>
/// <remarks>
/// Calls to the TPM library can potentially return a <see cref="TssException"/> or a <see cref="TpmException"/>
/// if your TPM hardware does not support the relevant API call.
/// </remarks>
/// <param name="encryptedKey">The encrypted identity key.</param>
public override void ActivateIdentityKey(byte[] encryptedKey)
{
Expand Down Expand Up @@ -168,6 +180,10 @@ public override void ActivateIdentityKey(byte[] encryptedKey)
/// <summary>
/// Gets the Base64 encoded EndorsmentKey.
/// </summary>
/// <remarks>
/// Calls to the TPM library can potentially return a <see cref="TssException"/> or a <see cref="TpmException"/>
/// if your TPM hardware does not support the relevant API call.
/// </remarks>
/// <returns>Base64 encoded EK.</returns>
public override byte[] GetEndorsementKey()
{
Expand All @@ -183,6 +199,10 @@ public override byte[] GetEndorsementKey()
/// <summary>
/// Gets the Base64 encoded StorageRootKey.
/// </summary>
/// <remarks>
/// Calls to the TPM library can potentially return a <see cref="TssException"/> or a <see cref="TpmException"/>
/// if your TPM hardware does not support the relevant API call.
/// </remarks>
/// <returns>Base64 encoded SRK.</returns>
public override byte[] GetStorageRootKey()
{
Expand All @@ -198,6 +218,10 @@ public override byte[] GetStorageRootKey()
/// <summary>
/// Signs the data using the previously activated identity key.
/// </summary>
/// <remarks>
/// Calls to the TPM library can potentially return a <see cref="TssException"/> or a <see cref="TpmException"/>
/// if your TPM hardware does not support the relevant API call.
/// </remarks>
/// <param name="data">The data to be signed.</param>
/// <returns>The signed data.</returns>
public override byte[] Sign(byte[] data)
Expand Down Expand Up @@ -251,6 +275,10 @@ public override byte[] Sign(byte[] data)
/// <summary>
/// Releases the unmanaged resources used by the SecurityProviderTpmHsm and optionally disposes of the managed resources.
/// </summary>
/// <remarks>
/// Calls to the TPM library can potentially return a <see cref="TssException"/> or a <see cref="TpmException"/>
/// if your TPM hardware does not support the relevant API call.
/// </remarks>
/// <param name="disposing">true to release both managed and unmanaged resources; false to releases only unmanaged resources.</param>
protected override void Dispose(bool disposing)
{
Expand Down

0 comments on commit 63ff0a2

Please sign in to comment.