Skip to content
/ genrsa Public

golang functions to generate rsa private and public keys in memory and files

Notifications You must be signed in to change notification settings

Yomiji/genrsa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

genrsa

Golang functions to generate rsa private and public keys in memory and files

dependency

dep ensure -add "github.com/Yomiji/genrsa"

useage

func TestKey(t *testing.T) {

	privateKey, publicKey := genrsa.MakeKeys(testByteCount)
	
	// do something with keys
}

func TestMakePrivatePublicFilePair(t *testing.T) {
		
	privateFile,err := os.OpenFile("testPriv", os.O_CREATE | os.O_TRUNC | os.O_WRONLY, privPerm)
	checkTheErr(err)
	
	publicFile,err := os.OpenFile("testPub", os.O_CREATE | os.O_TRUNC | os.O_WRONLY, pubPerm)
	checkTheErr(err)
	
	genrsa.MakePrivatePublicFilePair(privateFile, publicFile, testByteCount)
	
	privateFile.Close()
	publicFile.Close()
	
	// do something with files
}

About

golang functions to generate rsa private and public keys in memory and files

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages