1 7 8 9 package org.enhydra.oyster.util; 10 11 import java.math.BigInteger ; 12 13 14 21 public class DERLengthSearcher 22 { 23 24 27 private int lengthContent; 28 29 32 private int lengthLength; 33 34 43 public DERLengthSearcher (int startElement0, byte[] array0) { 44 this.newInitialization(startElement0, array0); 45 } 46 47 53 public void newInitialization (int startElement0, byte[] array0) 54 { 56 int numBytes; 57 byte[] temp; 58 if ((array0[startElement0 + 1] & 128) == 128) { 60 numBytes = array0[startElement0 + 1] & 0x7F; 61 if ((array0[startElement0 + 2] & 128) == 128) { 63 temp = new byte[numBytes + 1]; 64 temp[0] = 0; 65 for (int i = 0; i != numBytes; i++) 66 temp[i + 1] = array0[startElement0 + 2 + i]; 67 } 68 else { 69 temp = new byte[numBytes]; 70 for (int i = 0; i != numBytes; i++) 71 temp[i] = array0[startElement0 + 2 + i]; 72 } 73 lengthContent = new BigInteger (temp).intValue(); 74 lengthLength = numBytes + 1; 75 } 76 else { 77 lengthContent = array0[startElement0 + 1]; 78 lengthLength = 1; 79 } 80 } 81 82 86 public int getLengthtDERContentPart () { 87 return lengthContent; 88 } 89 90 94 public int getLengthtDERLengthPart () { 95 return lengthLength; 96 } 97 } 98 99 100 101 | Popular Tags |