secstring: github.com/worr/secstring Index | Files | Directories

package secstring

import "github.com/worr/secstring"

Index

Package Files

secstring.go

type SecString Uses

type SecString struct {
    String []byte // Protected string
    Length int    // Length of the target string
}

func FromString Uses

func FromString(str *string) (*SecString, error)

Makes a new SecString from a string reference. Destroys str after creating the secstring

func NewSecString Uses

func NewSecString(str []byte) (*SecString, error)

Takes a []byte and builds a SecString out of it, wiping str in the process.

A SecString should be destroyed when it's no longer needed to prevent memory leaks. It is probably a good idea to defer SecString.Destroy()

func (*SecString) Clone Uses

func (s *SecString) Clone() (*SecString, error)

func (*SecString) Destroy Uses

func (s *SecString) Destroy() error

Destroys the s. *MUST* be called to prevent memory leaks. Probably best to be called in a defer

Directories

PathSynopsis
example

Package secstring imports 4 packages (graph) and is imported by 2 packages. Updated 2016-07-17. Refresh now. Tools for package owners.