Net::LDAP::Extensions::Array

Public Instance Methods

to_ber(id = 0;) click to toggle source

to_ber_appsequence An application-specific sequence usually gets assigned a tag that is meaningful to the particular protocol being used. This is different from the universal sequence, which usually gets a tag value of 16. Now here’s an interesting thing: We’re adding the X.690 “application constructed” code at the top of the tag byte (0x60), but some clients, notably ldapsearch, send “context-specific constructed” (0xA0). The latter would appear to violate RFC-1777, but what do I know? We may need to change this.

    # File lib/net/ldap/core_ext/array.rb, line 18
18:         def to_ber                 id = 0; to_ber_seq_internal( 0x30 + id ); end
to_ber_appsequence(id = 0;) click to toggle source
    # File lib/net/ldap/core_ext/array.rb, line 21
21:         def to_ber_appsequence     id = 0; to_ber_seq_internal( 0x60 + id ); end
to_ber_contextspecific(id = 0;) click to toggle source
    # File lib/net/ldap/core_ext/array.rb, line 22
22:         def to_ber_contextspecific id = 0; to_ber_seq_internal( 0xA0 + id ); end
to_ber_oid() click to toggle source
    # File lib/net/ldap/core_ext/array.rb, line 24
24:         def to_ber_oid
25:           ary = self.dup
26:           first = ary.shift
27:           raise Net::BER::BerError.new( "invalid OID" ) unless [0,1,2].include?(first)
28:           first = first * 40 + ary.shift
29:           ary.unshift first
30:           oid = ary.pack("w*")
31:           [6, oid.length].pack("CC") + oid
32:         end
to_ber_sequence(id = 0;) click to toggle source
    # File lib/net/ldap/core_ext/array.rb, line 20
20:         def to_ber_sequence        id = 0; to_ber_seq_internal( 0x30 + id ); end
to_ber_set(id = 0;) click to toggle source
    # File lib/net/ldap/core_ext/array.rb, line 19
19:         def to_ber_set             id = 0; to_ber_seq_internal( 0x31 + id ); end

Private Instance Methods

to_ber_seq_internal(code) click to toggle source
    # File lib/net/ldap/core_ext/array.rb, line 35
35:         def to_ber_seq_internal code
36:           s = self.join
37:           [code].pack('C') + s.length.to_ber_length_encoding + s
38:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.