//----------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------- namespace System.IdentityModel.Protocols.WSTrust { using System.IdentityModel.Tokens; /// /// This class are used in defining Entropy and RequestProofToken element inside the /// RequestSecurityToken and RequestSecurityTokenResponse. /// public class ProtectedKey { byte[] _secret; EncryptingCredentials _wrappingCredentials; /// /// Use this constructor if we want to send the key material in clear text. /// /// The key material that needs to be protected. public ProtectedKey(byte[] secret) { _secret = secret; } /// /// Use this constructor if we want to send the key material encrypted. /// /// The key material that needs to be protected. /// The encrypting credentials used to encrypt the key material. public ProtectedKey(byte[] secret, EncryptingCredentials wrappingCredentials) { _secret = secret; _wrappingCredentials = wrappingCredentials; } /// /// Gets the key material. /// public byte[] GetKeyBytes() { return _secret; } /// /// Gets the encrypting credentials. Null means that the keys are not encrypted. /// public EncryptingCredentials WrappingCredentials { get { return _wrappingCredentials; } } } }