gss

package module
v0.0.0-...-7253261 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2023 License: MIT Imports: 4 Imported by: 0

README

gss

Golang Secure Strings

Abstract

A very simple package to wrap strings in a secure manner to prevent cleartext buffers.

Example

var buffer string
// fill buffer with a string, maybe from stdin
ss,key,err := gss.New(buffer)
if err != nil {
    panic(err)
}
defer ss.Destroy()

// access the seacure string
txt,err := ss.String(key)
if err != nil {
    panic(err)
}

// use txt...

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(u string) (*SecureString, *SecureKey, error)

New prepares a secure string with a new key.

Types

type SecureKey

type SecureKey struct {
	// contains filtered or unexported fields
}

func (*SecureKey) New

func (k *SecureKey) New(s string) (*SecureString, error)

New prepares a secure string based on an existing key.

type SecureString

type SecureString struct {
	// contains filtered or unexported fields
}

func (*SecureString) Destroy

func (s *SecureString) Destroy()

Destroy purges a secure string.

func (*SecureString) String

func (s *SecureString) String(k *SecureKey) (string, error)

String returns the readable string.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL