Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/lib/rex/proto/crypto_asn1/x509.rb
Views: 11704
# -*- coding: binary -*-1require 'rasn1'2require 'rex/proto/crypto_asn1/types'34module Rex::Proto::CryptoAsn1::X5095class X121Address < RASN1::Model6numeric_string :X121Address7end89class NetworkAddress < X121Address10root_options implicit: 011end1213class TerminalIdentifier < RASN1::Model14printable_string :TerminalIdentifier, implicit: 115end1617class AdministrationDomainName < RASN1::Model18choice :AdministrationDomainName, class: :application, explicit: 2, content: [19numeric_string(:numeric),20printable_string(:printable)21]22end2324class AttributeType < RASN1::Types::ObjectId25end2627class AttributeValue < RASN1::Types::Any28end2930class AttributeTypeAndValue < RASN1::Model31sequence :AttributeTypeAndValue, content: [32wrapper(model(:type, AttributeType)),33wrapper(model(:value, AttributeValue))34]35end3637class CountryName < RASN1::Model38choice :CountryName, class: :application, explicit: 1, content: [39numeric_string(:x121_dcc_code),40printable_string(:iso_3166_alpha2_code)41]42end4344class DirectoryString < RASN1::Model45choice :DirectoryString, content: [46teletex_string(:teletexString, strict_encoding: false),47printable_string(:printableString),48universal_string(:universalString),49utf8_string(:utf8String),50bmp_string(:bmpString)51]52end5354class EDIPartyName < RASN1::Model55sequence :EDIPartyName, content: [56wrapper(model(:nameAssigner, DirectoryString), implicit: 0, optional: true),57wrapper(model(:partyName, DirectoryString), implicit: 1)58]59end6061class ExtensionAttribute < RASN1::Model62sequence :ExtensionAttribute, content: [63integer(:extension_attribute_type, implicit: 0),64any(:extension_attribute_value, implicit: 1)65]66end6768class ExtensionAttributes < RASN1::Model69set_of(:ExtensionAttributes, ExtensionAttribute)70end7172class NumericUserIdentifier < RASN1::Model73numeric_string :NumericUserIdentifier, implicit: 474end7576class OrganizationName < RASN1::Model77printable_string :OrganizationName, implicit: 378end7980class OrganizationalUnitName < RASN1::Types::PrintableString81end8283class OrganizationalUnitNames < RASN1::Model84sequence_of(:OrganizationalUnitNames, OrganizationalUnitName)85end8687class PersonalName < RASN1::Model88set :PersonalName, content: [89printable_string(:surname, implicit: 0),90printable_string(:given_name, implicit: 1),91printable_string(:initials, implicit: 2),92printable_string(:generation_qualifier, implicit: 3)93]94end9596class PrivateDomainName < RASN1::Model97choice :PrivateDomainName, content: [98numeric_string(:numeric),99printable_string(:printable)100]101end102103class BuiltinDomainDefinedAttribute < RASN1::Model104sequence :BuiltinDomainDefinedAttribute, content: [105printable_string(:type),106printable_string(:value)107]108end109110class BuiltInDomainDefinedAttributes < RASN1::Model111sequence_of(:BuiltInDomainDefinedAttributes, BuiltinDomainDefinedAttribute)112end113114class BuiltInStandardAttributes < RASN1::Model115sequence :BuiltInStandardAttributes, content: [116wrapper(model(:country_name, CountryName), explicit: 0, class: :application, optional: true),117wrapper(model(:administration_domain_name, AdministrationDomainName), explicit: 1, class: :application, optional: true),118wrapper(model(:network_address, NetworkAddress), implicit: 0, optional: true),119wrapper(model(:terminal_identifier, TerminalIdentifier), implicit: 1, optional: false),120wrapper(model(:private_domain_name, PrivateDomainName), implicit: 2, optional: true),121wrapper(model(:organization_name, OrganizationName), implicit: 3, optional: true),122wrapper(model(:numeric_user_identifier, NumericUserIdentifier), implicit: 4, optional: true),123wrapper(model(:personal_name, PersonalName), implicit: 5, optional: true),124wrapper(model(:organizational_unit_names, OrganizationalUnitNames), implicit: 6, optional: true)125]126end127128class RelativeDistinguishedName < RASN1::Model129set_of(:RelativeDistinguishedName, AttributeTypeAndValue)130end131132class RDNSequence < RASN1::Model133sequence_of(:RDNSequence, RelativeDistinguishedName)134end135136class Name < RASN1::Model137choice :Name, content: [138wrapper(model(:RDNSequence, RDNSequence))139]140end141142class ORAddress < RASN1::Model143sequence :ORAddress, implicit: 3, content: [144wrapper(model(:built_in_standard_attributes, BuiltInStandardAttributes)),145wrapper(model(:built_in_domain_defined_attributes, BuiltInDomainDefinedAttributes), optional: true),146wrapper(model(:extension_attributes, ExtensionAttributes), optional: true)147]148end149150class OtherName < RASN1::Model151sequence :OtherName, implicit: 0, content: [152objectid(:type_id),153any(:value, explicit: 0, constructed: true)154]155end156157class GeneralName < RASN1::Model158choice :GeneralName, content: [159wrapper(model(:otherName, OtherName), implicit: 0),160ia5_string(:rfc822Name, implicit: 1),161ia5_string(:dNSName, implicit: 2),162wrapper(model(:x400Address, ORAddress), implicit: 3),163wrapper(model(:directoryName, Name), implicit: 4),164wrapper(model(:ediPartyName, EDIPartyName), implicit: 5),165ia5_string(:uniformResourceIdentifier, implicit: 6),166octet_string(:iPAddress, implicit: 7),167objectid(:registeredID, implicit: 8)168]169end170171# https://datatracker.ietf.org/doc/html/rfc3280#section-4.2.1.7172class GeneralNames < RASN1::Model173sequence_of(:GeneralNames, GeneralName)174end175176# https://datatracker.ietf.org/doc/html/rfc3280#section-4.2.1.7177class SubjectAltName < GeneralNames178end179180# https://datatracker.ietf.org/doc/html/rfc3280#section-4.2.1.5181class PolicyQualifierInfo < RASN1::Model182sequence :PolicyQualifierInfo, content: [183objectid(:policyQualifierId),184any(:qualifier)185]186end187188# https://datatracker.ietf.org/doc/html/rfc3280#section-4.2.1.5189class PolicyInformation < RASN1::Model190sequence :PolicyInformation, content: [191objectid(:policyIdentifier),192sequence_of(:policyQualifiers, PolicyQualifierInfo, optional: true)193]194end195196# https://datatracker.ietf.org/doc/html/rfc3280#section-4.2.1.5197class CertificatePolicies < RASN1::Model198sequence_of(:certificatePolicies, PolicyInformation)199end200end201202203