// Generated by Lisette bindgen
// Source: crypto/x509/pkix (Go stdlib)
// Go: 1.25.5
// Lisette: 0.1.20

import "go:encoding/asn1"
import "go:math/big"
import "go:time"

/// AlgorithmIdentifier represents the ASN.1 structure of the same name. See RFC
/// 5280, section 4.1.1.2.
pub struct AlgorithmIdentifier {
  pub Algorithm: asn1.ObjectIdentifier,
  pub Parameters: asn1.RawValue,
}

/// AttributeTypeAndValue mirrors the ASN.1 structure of the same name in
/// RFC 5280, Section 4.1.2.4.
pub struct AttributeTypeAndValue {
  pub Type: asn1.ObjectIdentifier,
  pub Value: Unknown,
}

/// AttributeTypeAndValueSET represents a set of ASN.1 sequences of
/// [AttributeTypeAndValue] sequences from RFC 2986 (PKCS #10).
pub struct AttributeTypeAndValueSET {
  pub Type: asn1.ObjectIdentifier,
  pub Value: Slice<Slice<AttributeTypeAndValue>>,
}

/// CertificateList represents the ASN.1 structure of the same name. See RFC
/// 5280, section 5.1. Use Certificate.CheckCRLSignature to verify the
/// signature.
/// 
/// Deprecated: x509.RevocationList should be used instead.
pub struct CertificateList {
  pub TBSCertList: TBSCertificateList,
  pub SignatureAlgorithm: AlgorithmIdentifier,
  pub SignatureValue: asn1.BitString,
}

/// Extension represents the ASN.1 structure of the same name. See RFC
/// 5280, section 4.2.
pub struct Extension {
  pub Id: asn1.ObjectIdentifier,
  pub Critical: bool,
  pub Value: Slice<uint8>,
}

/// Name represents an X.509 distinguished name. This only includes the common
/// elements of a DN. Note that Name is only an approximation of the X.509
/// structure. If an accurate representation is needed, asn1.Unmarshal the raw
/// subject or issuer as an [RDNSequence].
pub struct Name {
  pub Country: Slice<string>,
  pub Organization: Slice<string>,
  pub OrganizationalUnit: Slice<string>,
  pub Locality: Slice<string>,
  pub Province: Slice<string>,
  pub StreetAddress: Slice<string>,
  pub PostalCode: Slice<string>,
  pub SerialNumber: string,
  pub CommonName: string,
  pub Names: Slice<AttributeTypeAndValue>,
  pub ExtraNames: Slice<AttributeTypeAndValue>,
}

pub struct RDNSequence(Slice<RelativeDistinguishedNameSET>)

pub struct RelativeDistinguishedNameSET(Slice<AttributeTypeAndValue>)

/// RevokedCertificate represents the ASN.1 structure of the same name. See RFC
/// 5280, section 5.1.
pub struct RevokedCertificate {
  pub SerialNumber: Option<Ref<big.Int>>,
  pub RevocationTime: time.Time,
  pub Extensions: Slice<Extension>,
}

/// TBSCertificateList represents the ASN.1 structure of the same name. See RFC
/// 5280, section 5.1.
/// 
/// Deprecated: x509.RevocationList should be used instead.
pub struct TBSCertificateList {
  pub Raw: asn1.RawContent,
  pub Version: int,
  pub Signature: AlgorithmIdentifier,
  pub Issuer: RDNSequence,
  pub ThisUpdate: time.Time,
  pub NextUpdate: time.Time,
  pub RevokedCertificates: Slice<RevokedCertificate>,
  pub Extensions: Slice<Extension>,
}

impl CertificateList {
  /// HasExpired reports whether certList should have been updated by now.
  fn HasExpired(self: Ref<CertificateList>, now: time.Time) -> bool
}

impl Name {
  /// FillFromRDNSequence populates n from the provided [RDNSequence].
  /// Multi-entry RDNs are flattened, all entries are added to the
  /// relevant n fields, and the grouping is not preserved.
  fn FillFromRDNSequence(self: Ref<Name>, rdns: Ref<RDNSequence>)

  /// String returns the string form of n, roughly following
  /// the RFC 2253 Distinguished Names syntax.
  fn String(self) -> string

  /// ToRDNSequence converts n into a single [RDNSequence]. The following
  /// attributes are encoded as multi-value RDNs:
  /// 
  ///   - Country
  ///   - Organization
  ///   - OrganizationalUnit
  ///   - Locality
  ///   - Province
  ///   - StreetAddress
  ///   - PostalCode
  /// 
  /// Each ExtraNames entry is encoded as an individual RDN.
  fn ToRDNSequence(self) -> RDNSequence
}

impl RDNSequence {
  /// String returns a string representation of the sequence r,
  /// roughly following the RFC 2253 Distinguished Names syntax.
  fn String(self) -> string
}
