Documentation ¶
Overview ¶
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2014-2019 Cesanta Software Limited All rights reserved
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func GeneratePrivateKey(ctx context.Context, keyType CertType, useATCA bool, devConn dev.DevConn, ...) (crypto.Signer, []byte, []byte, error)
- func LoadCertAndKey(certFile, keyFile string) ([]byte, []byte, crypto.Signer, []byte, []byte, error)
- func LoadOrGenerateCertAndKey(ctx context.Context, certType CertType, certFile, keyFile string, ...) ([]byte, []byte, crypto.Signer, []byte, []byte, error)
- func PrintCertInfo(certDERBytes []byte)
- func WriteAndUploadFile(ctx context.Context, fileType string, data []byte, ...) (string, error)
- func WritePEM(derBytes []byte, blockType string, outputFileName string) error
- func WritePubKey(pubKey *ecdsa.PublicKey, outputFileName string) error
- type AttributeTypeAndValue
- type CertType
- type DN
- type RelativeDN
Constants ¶
This section is empty.
Variables ¶
var ( CertCN = "" ATCASlot = 0 CertValidity time.Duration )
Functions ¶
func GeneratePrivateKey ¶
func LoadCertAndKey ¶
func PrintCertInfo ¶
func PrintCertInfo(certDERBytes []byte)
func WriteAndUploadFile ¶
Types ¶
type AttributeTypeAndValue ¶
type AttributeTypeAndValue struct { // Type is the attribute type Type string // Value is the attribute value Value string }
AttributeTypeAndValue represents an attributeTypeAndValue from https://tools.ietf.org/html/rfc4514
type CertType ¶
type CertType string
const ( CertTypeRSA CertType = "RSA" CertTypeECDSA = "ECDSA" )
func PickCertType ¶
func PickCertType(devInfo *dev.GetInfoResult) (CertType, bool, error)
type DN ¶
type DN struct {
RDNs []*RelativeDN
}
DN represents a distinguishedName from https://tools.ietf.org/html/rfc4514
type RelativeDN ¶
type RelativeDN struct {
Attributes []*AttributeTypeAndValue
}
RelativeDN represents a relativeDistinguishedName from https://tools.ietf.org/html/rfc4514