@Override TypeDescription getMmsTypeSpec() { TypeDescription typeDescription = new TypeDescription(); typeDescription.setUtcTime(new BerNull()); return typeDescription; }
@Override TypeDescription getMmsTypeSpec() { TypeDescription typeDescription = new TypeDescription(); typeDescription.setBool(new BerNull()); return typeDescription; }
@Override TypeDescription getMmsTypeSpec() { TypeDescription typeDescription = new TypeDescription(); typeDescription.setUtcTime(new BerNull()); return typeDescription; }
@Override TypeDescription getMmsTypeSpec() { TypeDescription typeDescription = new TypeDescription(); typeDescription.setBool(new BerNull()); return typeDescription; }
public int decode(InputStream is, BerTag berTag) throws IOException { int codeLength = 0; BerTag passedTag = berTag; if (berTag == null) { berTag = new BerTag(); codeLength += berTag.decode(is); } if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { vmdSpecific = new BerNull(); codeLength += vmdSpecific.decode(is, false); return codeLength; } if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { domainSpecific = new Identifier(); codeLength += domainSpecific.decode(is, false); return codeLength; } if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) { aaSpecific = new BerNull(); codeLength += aaSpecific.decode(is, false); return codeLength; } if (passedTag != null) { return 0; } throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); }
public int decode(InputStream is, BerTag berTag) throws IOException { int codeLength = 0; BerTag passedTag = berTag; if (berTag == null) { berTag = new BerTag(); codeLength += berTag.decode(is); } if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { vmdSpecific = new BerNull(); codeLength += vmdSpecific.decode(is, false); return codeLength; } if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { domainSpecific = new Identifier(); codeLength += domainSpecific.decode(is, false); return codeLength; } if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) { aaSpecific = new BerNull(); codeLength += aaSpecific.decode(is, false); return codeLength; } if (passedTag != null) { return 0; } throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); }
public int decode(InputStream is, BerTag berTag) throws IOException { int codeLength = 0; BerTag passedTag = berTag; if (berTag == null) { berTag = new BerTag(); codeLength += berTag.decode(is); } if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { failure = new DataAccessError(); codeLength += failure.decode(is, false); return codeLength; } if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { success = new BerNull(); codeLength += success.decode(is, false); return codeLength; } if (passedTag != null) { return 0; } throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); }
public int decode(InputStream is, BerTag berTag) throws IOException { int codeLength = 0; BerTag passedTag = berTag; if (berTag == null) { berTag = new BerTag(); codeLength += berTag.decode(is); } if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) { failure = new DataAccessError(); codeLength += failure.decode(is, false); return codeLength; } if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) { success = new BerNull(); codeLength += success.decode(is, false); return codeLength; } if (passedTag != null) { return 0; } throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item."); }
private ConfirmedServiceRequest constructGetServerDirectoryRequest() { ObjectClass objectClass = new ObjectClass(); objectClass.setBasicObjectClass(new BerInteger(9)); GetNameListRequest.ObjectScope objectScope = new GetNameListRequest.ObjectScope(); objectScope.setVmdSpecific(new BerNull()); GetNameListRequest getNameListRequest = new GetNameListRequest(); getNameListRequest.setObjectClass(objectClass); getNameListRequest.setObjectScope(objectScope); ConfirmedServiceRequest confirmedServiceRequest = new ConfirmedServiceRequest(); confirmedServiceRequest.setGetNameList(getNameListRequest); return confirmedServiceRequest; }
private ConfirmedServiceRequest constructGetServerDirectoryRequest() { ObjectClass objectClass = new ObjectClass(); objectClass.setBasicObjectClass(new BerInteger(9)); GetNameListRequest.ObjectScope objectScope = new GetNameListRequest.ObjectScope(); objectScope.setVmdSpecific(new BerNull()); GetNameListRequest getNameListRequest = new GetNameListRequest(); getNameListRequest.setObjectClass(objectClass); getNameListRequest.setObjectScope(objectScope); ConfirmedServiceRequest confirmedServiceRequest = new ConfirmedServiceRequest(); confirmedServiceRequest.setGetNameList(getNameListRequest); return confirmedServiceRequest; }
@Test public void puk() throws Exception { ProfileElement pukProfileElement = new ProfileElement(); PEPUKCodes.PukCodes pukCodes = new PEPUKCodes.PukCodes(Arrays.asList( createPUK((byte) 1, "3030303030303030", (byte) 9, (byte) 9), createPUK((byte) 2, "3132333435363738"), createPUK((byte) 0x81, "3132333435363738", (byte) 8, (byte) 8))); PEPUKCodes pepukCodes = new PEPUKCodes(new PEHeader(new BerNull(), new UInt15(2)), pukCodes); pukProfileElement.pukCodes = pepukCodes; ReverseByteArrayOutputStream reverseOutputStream = new ReverseByteArrayOutputStream(2048, true); pukProfileElement.encode(reverseOutputStream); byte[] code = reverseOutputStream.getArray(); System.out.println(HexConverter.toShortHexString(code)); ProfileElement rereadProfileElement = new ProfileElement(); rereadProfileElement.decode(new ByteArrayInputStream(code), null); ReverseByteArrayOutputStream reverseOutputStream2 = new ReverseByteArrayOutputStream(2048, true); rereadProfileElement.encode(reverseOutputStream2); byte[] code2 = reverseOutputStream2.getArray(); Assert.assertArrayEquals(code, code2); String expected = "A3 3F A0 05 80 00 81 01 02 A1 36 30 11 80 01 01 81 08 3030303030303030 82 02 0099 30 0D 80 01 02 81 08 3132333435363738 30 12 80 02 0081 81 08 3132333435363738 82 02 0088" .replaceAll("\\s", ""); Assert.assertEquals(expected, DatatypeConverter.printHexBinary(code)); }
allElements = new BerNull(); codeLength += allElements.decode(is, false); return codeLength;
allElements = new BerNull(); codeLength += allElements.decode(is, false); return codeLength;
allElements = new BerNull(); codeLength += allElements.decode(is, false); return codeLength;
allElements = new BerNull(); codeLength += allElements.decode(is, false); return codeLength;
@Test public void header() throws Exception { ProfileElement headerProfileElement = new ProfileElement(); ServicesList servicesList = new ServicesList(); ProfileHeader.EUICCMandatoryGFSTEList GFSTEList = new ProfileHeader.EUICCMandatoryGFSTEList(); GFSTEList.seqOf = Arrays.asList(new BerObjectIdentifier(new int[] { 2, 23, 143, 1, 2, 1 }), new BerObjectIdentifier(new int[] { 2, 23, 143, 1, 2, 4 })); servicesList.usim = new BerNull(); servicesList.milenage = new BerNull(); servicesList.javacard = new BerNull(); headerProfileElement.header = new ProfileHeader(new UInt8(2), new UInt8(0), new BerUTF8String("SIMalliance Sample Profile"), new BerOctetString(DatatypeConverter.parseHexBinary("89019990001234567893")), null, servicesList, GFSTEList, null); ReverseByteArrayOutputStream reverseByteArrayOutputStream = new ReverseByteArrayOutputStream(2048, true); headerProfileElement.encode(reverseByteArrayOutputStream); byte[] code = reverseByteArrayOutputStream.getArray(); ProfileElement rereadProfileElement = new ProfileElement(); rereadProfileElement.decode(new ByteArrayInputStream(code), null); ReverseByteArrayOutputStream reverseOutputStream2 = new ReverseByteArrayOutputStream(2048, true); rereadProfileElement.encode(reverseOutputStream2); byte[] code2 = reverseOutputStream2.getArray(); Assert.assertArrayEquals(code, code2); String expected = "A0 48 80 01 02 81 01 00 82 1A 53494D616C6C69616E63652053616D706C652050726F66696C65 83 0A 89019990001234567893 A5 06 81 00 84 00 8B 00 A6 10 06 06 67810F010201 06 06 67810F010204" .replaceAll("\\s", ""); Assert.assertEquals(expected, DatatypeConverter.printHexBinary(code)); }
fixed = new BerNull(); codeLength += fixed.decode(is, false); return codeLength;
fixed = new BerNull(); codeLength += fixed.decode(is, false); return codeLength;
fixed = new BerNull(); codeLength += fixed.decode(is, false); return codeLength;
doNotCreate = new BerNull(); codeLength += doNotCreate.decode(is, false); return codeLength;