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

     1  // Copyright 2023 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/encoding/asn1"
     9  )
    10  
    11  // OIDはASN.1 OBJECT IDENTIFIERを表します。
    12  type OID struct {
    13  	der []byte
    14  }
    15  
    16  // OIDFromIntsは、整数を使用して新しいOIDを作成します。各整数は別々のコンポーネントです。
    17  func OIDFromInts(oid []uint64) (OID, error)
    18  
    19  // Equalは、oidとotherが同じオブジェクト識別子を表している場合にtrueを返します。
    20  func (oid OID) Equal(other OID) bool
    21  
    22  // EqualASN1OIDは、OIDがasn1.ObjectIdentifierと等しいかどうかを返します。もし
    23  // asn1.ObjectIdentifierがoidによって指定されたOIDを表現できない場合、
    24  // OIDのコンポーネントが31ビット以上必要とする場合、falseを返します。
    25  func (oid OID) EqualASN1OID(other asn1.ObjectIdentifier) bool
    26  
    27  // Stringsはオブジェクト識別子の文字列表現を返します。
    28  func (oid OID) String() string