Permalink
Browse files

Initial import.

  • Loading branch information...
0 parents commit a34d8293fd62d72da346827dd3a45ba250d80442 @macks committed Oct 29, 2009
340 COPYING

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,17 @@
+2005-12-22 19:48:28 +0900 macks
+
+ * Release 0.3
+ * Bug fix.
+ - decoder: Failed to decode constructor formed string.
+ * Cleaned up code.
+
+2005-12-04 15:05:26 +0900 macks
+
+ * Release 0.2
+ * Change class structures.
+ * Bug fix.
+ - decoder: explicit tagging was corrupted.
+
+2005-11-16 03:25:40 +0900 macks
+
+ * Initial release.
102 README
@@ -0,0 +1,102 @@
+rubyasn1
+========
+
+This library will parse ASN.1 notations and create converter object which
+encode Ruby data structures using BER (Basic Encoding Rules) and vice versa.
+
+The library is still EXPERIMENTAL and not implemented completely.
+APIs may be changed in future version.
+
+
+Install
+=======
+
+On almost all unix-like systems, type the followings for quick install.
+
+ $ su
+ # ruby setup.rb
+
+If you want to customize install directories, type the following for help.
+
+ $ ruby setup.rb --help
+
+
+How to use
+==========
+
+Example 1:
+
+ parser = ASN1::Parser.new
+ converter = parser.parse(%<
+ seq SEQUENCE {
+ integer INTEGER,
+ bool BOOLEAN,
+ str STRING
+ }
+ >)
+
+ # Encode
+ binary = converter.encode( :seq => {
+ :integer => 1, :bool => false, :str => 'A string'
+ } )
+ p binary
+ #=> "0\020\002\001\001\001\001\000\004\bA string"
+
+ # Decode
+ object = conter.decode(ber_binary)
+ p object
+ #=> {:seq=>{:integer=>1, :bool=>false, :str=>"A string"}}
+
+
+Example 2:
+
+ parser = ASN1::Parser.new
+ converter = parser.parse(%<
+ AddressBook ::= SEQUENCE OF Person
+
+ Person ::= SEQUENCE {
+ name STRING,
+ age INTEGER,
+ email STRING OPTIONAL
+ }
+ >)
+
+ # Check compilation error
+ if converter.nil?
+ puts parser.error
+ puts parser.backtrace
+ abort
+ end
+
+ # Select a type
+ converter.select('AddressBook')
+
+ # Encode
+ binary = converter.encode([
+ { :name => 'Bob', :age => 24 },
+ { :name => 'John', :age => 18, :email => 'john@example.com' },
+ ])
+ p binary
+ #=> "0'0\b\004\003Bob\002\001\0300\e\004\004John\002\001\022\004\020john@example.com"
+
+ # Decode
+ object = converter.decode(binary)
+ p object
+ #=> [{:age=>24, :name=>"Bob"}, {:age=>18, :email=>"john@example.com", :name=>"John"}]
+
+
+Copyright
+=========
+
+Copyright(C)2005 MATSUYAMA Kengo <macksx@gmail.com>. All rights reserved.
+This module is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+This module is based on a porting of Convert::ASN1 module for Perl.
+Convert::ASN1 is copyrighted by Graham Barr.
+For more details, see http://search.cpan.org/~gbarr/Convert-ASN1-0.19/
+
+setup.rb is copyrighted by Minero Aoki.
+For more details, see http://raa.ruby-lang.org/project/setup/
9 TODO
@@ -0,0 +1,9 @@
+TODO
+====
+ * Rakefile
+ * Rdoc
+ * Ruby 1.9
+ * ASN.1 standards
+ * Rewrite parser.
+ * Implement ENUM and ENUMERATED.
+ * Implement constant value.
@@ -0,0 +1,10 @@
+libasn1-ruby1.8 for Debian
+--------------------------
+
+This module will parse ASN.1 notations and encode Ruby data structures
+using BER (Basic Encoding Rules) and vice versa.
+
+This release is EXPERIMENTAL. Class names and method names woule be
+changed in future release.
+
+ -- MATSUYAMA Kengo <macksx@gmail.com>, Wed, 16 Nov 2005 12:11:32 +0900
@@ -0,0 +1,21 @@
+libasn1-ruby1.8 (0.3) experimental; urgency=low
+
+ * Release 0.3.
+ * Bug fixed.
+ * Cleaned up code.
+
+ -- macks <macksx@gmail.com> Thu, 22 Dec 2005 19:51:46 +0900
+
+libasn1-ruby1.8 (0.2) experimental; urgency=low
+
+ * Release 0.2.
+ * Class structure was changed.
+
+ -- macks <macksx@gmail.com> Sun, 4 Dec 2005 15:09:17 +0900
+
+libasn1-ruby1.8 (0.1) experimental; urgency=low
+
+ * Initial Release.
+
+ -- macks <macksx@gmail.com> Wed, 16 Nov 2005 12:11:32 +0900
+
@@ -0,0 +1 @@
+4
@@ -0,0 +1,18 @@
+Source: libasn1-ruby1.8
+Section: interpreters
+Priority: optional
+Maintainer: MATSUYAMA Kengo <macksx@gmail.com>
+Build-Depends: debhelper (>= 4.0.0), racc
+Standards-Version: 3.6.1
+
+Package: libasn1-ruby1.8
+Architecture: all
+Depends: libruby1.8, libracc-runtime-ruby1.8, libstrscan-ruby1.8
+Description: ASN.1 parser and BER encoder/decoder for Ruby.
+ This module will parse ASN.1 notations, encode Ruby data structures
+ using BER (Basic Encoding Rules) and vice versa.
+ .
+ This is EXPERIMENTAL version. Class names and method names would be
+ changed in future version.
+ .
+ This module is based on a porting of Convert::ASN1 module for Perl.
@@ -0,0 +1,25 @@
+This package was debianized by MATSUYAMA Kengo <macksx@gmail.com> on
+Wed, 16 Nov 2005 12:11:32 +0900.
+
+Copyright Holder: MATSUYAMA Kengo <macksx@gmail.com>
+
+License:
+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this package; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
@@ -0,0 +1,2 @@
+README
+TODO
@@ -0,0 +1,44 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ ruby setup.rb config --installdirs=std
+ touch configure-stamp
+
+build: build-stamp
+build-stamp: configure-stamp
+ ruby setup.rb setup
+ touch build-stamp
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+ ruby setup.rb clean
+ dh_clean
+
+install: build-stamp
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+ ruby setup.rb install --prefix=$(CURDIR)/debian/libasn1-ruby1.8
+
+binary: install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs ChangeLog
+ dh_installdocs
+ dh_compress
+ dh_fixperms
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+.PHONY: build clean binary install configure
Oops, something went wrong.

0 comments on commit a34d829

Please sign in to comment.