Share via


Entropy Constructor (Int32, SecurityToken)

Initializes a new instance of the Entropy class with a randomly generated entropy value of the specified size that is encrypted using the specified security token.

Namespace: Microsoft.Web.Services2.Security
Assembly: Microsoft.Web.Services2 (in microsoft.web.services2.dll)

Usage

'Usage
Dim sizeInBytes As Integer
Dim encryptingToken As SecurityToken
Dim entropy1 As New Entropy(sizeInBytes, encryptingToken)

Syntax

'Declaration
Public Sub New( _
    ByVal sizeInBytes As Integer, _
    ByVal encryptingToken As SecurityToken _
)
public Entropy(
    int sizeInBytes, 
    SecurityToken encryptingToken
);
public: Entropy(
    Int32 sizeInBytes, 
    SecurityToken^ encryptingToken
);
public Entropy(
    int sizeInBytes, 
    SecurityToken encryptingToken
);
public function Entropy(
     sizeInBytes : int, 
     encryptingToken : SecurityToken
);

Parameters

  • sizeInBytes
    The size of the randomly generated entropy value, in bytes.
  • encryptingToken
    The SecurityToken that is used to encrypt the entropy value.

Exceptions

Exception type Condition
System.ArgumentOutOfRangeException

sizeInBytes is less than or equal to zero.

System.ArgumentNullException

encryptingToken is null.

Remarks

This constructor sets the value of the EncryptedKey property to an EncryptedKey that contains the randomly generated entropy value. When the Entropy class is serialized into XML, the entropy value is encrypted using the security token specified in the encryptingToken parameter and placed in an <EncryptedKey> child element. Typically, the encryptingToken parameter is the public key of the security token service, so that only the security token service can decrypt the entropy value.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Longhorn, and Windows 2000

Target Platforms

Windows 2000, Windows 2000 Server, Windows 2000 Advanced Server, Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Longhorn, Pocket PC, Windows CE, Smart Phone

See Also

Reference

Entropy Class
Microsoft.Web.Services2.Security Namespace
EncryptedKey
EncryptedKey

Other Resources

Entropy Members