CryptoSys PKI Pro Manual

Wipe.String Method

Zeroise a StringBuilder.

Syntax

[C#]
public static bool String(
   StringBuilder sb 
)
[VB]
Public Shared Function String (
   sb As StringBuilder 
) As Boolean

Parameters

sb  StringBuilder
StringBuilder to be wiped

Return Value

Boolean
true if successful; false if fails

Remarks

NB You can't wipe an ordinary string as they are immutable in C#, so store any sensitive string data in a StringBuilder.

Example

StringBuilder sbPrivateKey = Rsa.ReadPrivateKey("BobPrivRSAEncrypt.p8e", "password");
Console.WriteLine("Before Wipe.String, sbPrivateKey contains {0} characters.", sbPrivateKey.Length);
Wipe.String(sbPrivateKey);
Console.WriteLine("After Wipe.String, sbPrivateKey = [{0}]", sbPrivateKey.ToString());
// Before Wipe.String, sbPrivateKey contains 848 characters.
// After Wipe.String, sbPrivateKey = []

See Also

VB6/C equivalent: WIPE_Data

[Contents] [Index]

[PREV: Wipe.File Method...]   [Contents]   [Index]   
   [NEXT: X509.CertExpiresOn Method...]

Copyright © 2004-26 D.I. Management Services Pty Ltd t/a CryptoSys. All rights reserved. Generated 2026-09-21T05:59:39Z.