Skip to content

Commit

Permalink
fix: Modified PEM file type string
Browse files Browse the repository at this point in the history
The standard PEM key file should named "RSA PRIVATE KEY" or "RSA PUBLIC KEY".

fixed: kairoaraujo#42
  • Loading branch information
ZenkieBear committed May 10, 2024
1 parent 70fea28 commit 889f286
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ count.out
coverage.out
DoNotUseThisCAPATHTestOnly/
docs-test/
cover.out
cover.out
store
6 changes: 3 additions & 3 deletions _storage/storage.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2020, Kairo de Araujo
// # Copyright (c) 2020, Kairo de Araujo
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -60,7 +60,7 @@ func savePEMKey(fileName string, key *rsa.PrivateKey) {
checkError(err)

var privateKey = &pem.Block{
Type: "PRIVATE KEY",
Type: "RSA PRIVATE KEY",
Bytes: x509.MarshalPKCS1PrivateKey(key),
}

Expand All @@ -73,7 +73,7 @@ func savePublicPEMKey(fileName string, pubkey rsa.PublicKey) {
checkError(err)

var pemkey = &pem.Block{
Type: "PUBLIC KEY",
Type: "RSA PUBLIC KEY",
Bytes: asn1Bytes,
}

Expand Down

0 comments on commit 889f286

Please sign in to comment.