Updating npm externals
[KiwiIRC.git] / node / node_modules / socket.io-client / lib / vendor / web-socket-js / flash-src / com / hurlant / util / der / ByteString.as
1 /**
2 * ByteString
3 *
4 * An ASN1 type for a ByteString, represented with a ByteArray
5 * Copyright (c) 2007 Henri Torgemane
6 *
7 * See LICENSE.txt for full license information.
8 */
9 package com.hurlant.util.der
10 {
11 import flash.utils.ByteArray;
12 import com.hurlant.util.Hex;
13
14 public class ByteString extends ByteArray implements IAsn1Type
15 {
16 private var type:uint;
17 private var len:uint;
18
19 public function ByteString(type:uint = 0x04, length:uint = 0x00) {
20 this.type = type;
21 this.len = length;
22 }
23
24 public function getLength():uint
25 {
26 return len;
27 }
28
29 public function getType():uint
30 {
31 return type;
32 }
33
34 public function toDER():ByteArray {
35 return DER.wrapDER(type, this);
36 }
37
38 override public function toString():String {
39 return DER.indent+"ByteString["+type+"]["+len+"]["+Hex.fromArray(this)+"]";
40 }
41
42 }
43 }