blob: fb8b280702a971dbeaf082674f7c41b0a651d5d5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
/**
* 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)+"]";
}
}
}
|