Skip to content

Commit

Permalink
Comment about manually wiping SecureString
Browse files Browse the repository at this point in the history
  • Loading branch information
omus committed Nov 24, 2017
1 parent 607dde3 commit 75faf97
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions base/strings/string.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,20 @@ end
SecureString(string::AbstractString)
A string where the contents will be securely wiped when the last reference to the secure
string has been removed. If `string` is of type `String` then the memory of the original
parameter will also be securely wiped.
string has been removed. However, it is considered best practise to wipe the string using
`securezero!(::SecureString)` as soon as the secure data is no longer required. Note that
when the `string` parameter is of type `String` then the memory of the original string
will also be securely wiped.
# Examples
```jldoctest
julia> str = "abc"
julia> str = "abc"::String
"abc"
julia> SecureString(str)
"abc"
julia> gc() # Cause the SecureString above to be garbage collected
julia> gc() # Ensure the SecureString above is finalized
julia> str
"\0\0\0"
Expand Down

0 comments on commit 75faf97

Please sign in to comment.