github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/crypto/x509/sec1.go (about)

     1  // Copyright 2012 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package x509
     6  
     7  import (
     8  	"github.com/shogo82148/std/crypto/ecdsa"
     9  )
    10  
    11  // ParseECPrivateKeyはSEC 1、ASN.1 DER形式のECプライベートキーを解析します。
    12  //
    13  // この種類のキーは、一般的に "EC PRIVATE KEY" タイプのPEMブロックにエンコードされています。
    14  func ParseECPrivateKey(der []byte) (*ecdsa.PrivateKey, error)
    15  
    16  // MarshalECPrivateKeyは、ECの秘密鍵をSEC 1、ASN.1 DER形式に変換します。
    17  //
    18  // この種類の鍵は、一般的にはタイプ"EC PRIVATE KEY"のPEMブロックにエンコードされます。
    19  // EC固有でないより柔軟な鍵形式を使用する場合は、 [MarshalPKCS8PrivateKey] を使用します。
    20  func MarshalECPrivateKey(key *ecdsa.PrivateKey) ([]byte, error)