本文簡要介紹ruby語言中OpenSSL::ASN1::Constructive.OpenSSL::ASN1::Primitive.new的用法。
用法
OpenSSL::ASN1::Primitive.new(value [, tag, tagging, tag_class ]) → Primitive
value :是強製性的。
tag :可選,可以為標記值指定。如果沒有指定tag,則默認使用 Primitive sub-class對應的UNIVERSAL標簽。
tagging :可用作編碼提示以顯式或隱式編碼值,請參閱 ASN1 了解可能的值。
tag_class :如果 tag 和 tagging 是 nil 則默認設置為 :UNIVERSAL。如果設置了tag 或tagging,則默認使用:CONTEXT_SPECIFIC。對於可能的值,請參閱。 ASN1 。
示例
int = OpenSSL::ASN1::Integer.new(42)
zero_tagged_int = OpenSSL::ASN1::Integer.new(42, 0, :IMPLICIT)
private_explicit_zero_tagged_int = OpenSSL::ASN1::Integer.new(42, 0, :EXPLICIT, :PRIVATE)
相關用法
- Ruby Primitive類用法及代碼示例
- Ruby PrettyPrint.current_group用法及代碼示例
- Ruby Process.groups用法及代碼示例
- Ruby Process.wait2用法及代碼示例
- Ruby Process.getpgrp用法及代碼示例
- Ruby Proc.eql?用法及代碼示例
- Ruby PrettyPrint.genspace用法及代碼示例
- Ruby Profiler模塊用法及代碼示例
- Ruby Process.setproctitle用法及代碼示例
- Ruby Process.setrlimit用法及代碼示例
- Ruby Proc.prc ==用法及代碼示例
- Ruby Profiler.raw_data用法及代碼示例
- Ruby Process.uid用法及代碼示例
- Ruby Process.pid用法及代碼示例
- Ruby Proc.ruby2_keywords用法及代碼示例
- Ruby Proc.new用法及代碼示例
- Ruby Process.detach用法及代碼示例
- Ruby Process.maxgroups用法及代碼示例
- Ruby Process.clock_gettime用法及代碼示例
- Ruby Proc.lambda?用法及代碼示例
- Ruby Proc.arity用法及代碼示例
- Ruby Process.exec用法及代碼示例
- Ruby Process.groups=用法及代碼示例
- Ruby Proc.(params,...)用法及代碼示例
- Ruby Profiler.result用法及代碼示例
注:本文由純淨天空篩選整理自ruby-lang.org大神的英文原創作品 Primitive.new。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
