# Copyright (c) 2024 Yuki Kimoto
# MIT License

class Net::SSLeay::X509_EXTENSION : pointer {
  version_from Net::SSLeay;
  
  allow Net::SSLeay::X509;
  
  use Net::SSLeay::X509;
  use Net::SSLeay::ASN1_OCTET_STRING;
  use Net::SSLeay::ASN1_OBJECT;
  use Fn;
  
  # Class Methods
  native static method new : Net::SSLeay::X509_EXTENSION ();
  
  private static method new_with_pointer : Net::SSLeay::X509_EXTENSION ($pointer : Address, $options : object[] = undef) {
    
    my $self = new Net::SSLeay::X509_EXTENSION;
    
    Fn->set_pointer($self, $pointer);
    
    return $self;
  }
  
  # Instance Methods
  native method get_data : Net::SSLeay::ASN1_OCTET_STRING ();
  
  native method get_object : Net::SSLeay::ASN1_OBJECT ();
  
  native method get_critical : int ();
  
  native method set_object : int ($obj : Net::SSLeay::ASN1_OBJECT);
  
  native method set_critical : int ($crit : int);
  
  native method set_data : int ($data : Net::SSLeay::ASN1_OCTET_STRING);
  
  native method DESTROY : void ();
  
}