/js/lib/Socket.IO-node/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/ByteString.as
ActionScript | 43 lines | 28 code | 7 blank | 8 comment | 0 complexity | a2b660f7970ef36aeb6a0c5a28302b05 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, MPL-2.0-no-copyleft-exception, BSD-3-Clause
- /**
- * ByteString
- *
- * An ASN1 type for a ByteString, represented with a ByteArray
- * Copyright (c) 2007 Henri Torgemane
- *
- * See LICENSE.txt for full license information.
- */
- package com.hurlant.util.der
- {
- import flash.utils.ByteArray;
- import com.hurlant.util.Hex;
- public class ByteString extends ByteArray implements IAsn1Type
- {
- private var type:uint;
- private var len:uint;
-
- public function ByteString(type:uint = 0x04, length:uint = 0x00) {
- this.type = type;
- this.len = length;
- }
-
- public function getLength():uint
- {
- return len;
- }
-
- public function getType():uint
- {
- return type;
- }
-
- public function toDER():ByteArray {
- return DER.wrapDER(type, this);
- }
-
- override public function toString():String {
- return DER.indent+"ByteString["+type+"]["+len+"]["+Hex.fromArray(this)+"]";
- }
-
- }
- }