lib/ccrypto/configs/x509_cert_profile.rb in ccrypto-0.1.3 vs lib/ccrypto/configs/x509_cert_profile.rb in ccrypto-0.2.0

- old
+ new

@@ -25,11 +25,11 @@ attr_accessor :raise_if_validity_date_not_in_issuer_range attr_accessor :issuer_path_len def initialize - @hashAlgo = Ccrypto::SHA256 + @hashAlgo = :sha256 @serial = SecureRandom.hex(16) @subj_key_id = true @auth_key_id = true @issuerCert = false now = Time.now @@ -229,10 +229,11 @@ end @not_after = @not_before.advance(adv) end + alias_method :valid_for, :validity def match_issuer_not_before(issuer_not_before) if not_empty?(issuer_not_before) if issuer_not_before.is_a?(Time) if issuer_not_before > @not_before @@ -312,16 +313,16 @@ clientAuth: "TLS client authentication", codeSigning: "Code signing", emailProtection: "Email protection", timeStamping: "Time stamping", OCSPSigning: "Online Cert Status Protocol signing", - ipSecIKE: "IPSec Initial Key Exchange", - msCodeInd: "Microsoft Code Ind", - msCodeCom: "Microsoft Code Com", - msCtlsign: "Microsoft CTL Sign", - msEFS: "Microsoft EFS", - dvcs: "DVCS purposes" + #ipSecIKE: "IPSec Initial Key Exchange", + #msCodeInd: "Microsoft Code Ind", + #msCodeCom: "Microsoft Code Com", + #msCtlsign: "Microsoft CTL Sign", + #msEFS: "Microsoft EFS", + #dvcs: "DVCS purposes" } def initialize @selected = { } @@ -369,16 +370,18 @@ end def add_custom_extension(oid, value, type = :string, critical = false) custom_extension[oid] = { type: type, value: value, critical: critical } end + alias_method :add_domain_extension, :add_custom_extension def custom_extension if @custom_extension.nil? @custom_extension = { } end @custom_extension end + alias_method :domain_extension, :custom_extension end end end