/** * Confirm that the byte at the current position matches the given value. * * @param val the expected next byte. * @throws WSSecurityException * if the current position is at the end of the array, or if the * byte at the current position doesn't match the expected value. */ public void expect(int val) throws WSSecurityException { expect((byte)(val & 0xFF)); }
/** * Construct a DERDecoder for the given byte array. * * @param derEncoded the DER-encoded array to decode. * @throws WSSecurityException if the given array is null. */ public DERDecoder(byte[] derEncoded) throws WSSecurityException { if (derEncoded == null) { throw new WSSecurityException( WSSecurityException.UNSUPPORTED_SECURITY_TOKEN, "noSKIHandling", new Object[] { "Invalid DER string" } ); } arr = derEncoded; reset(); }
/** * Confirm that the byte at the current position matches the given value. * * @param val the expected next byte. * @throws WSSecurityException * if the current position is at the end of the array, or if the * byte at the current position doesn't match the expected value. */ public void expect(byte val) throws WSSecurityException { if (!test(val)) { log.debug("DER mismatch: expected " + val + ", got " + arr[pos]); throw new WSSecurityException( WSSecurityException.UNSUPPORTED_SECURITY_TOKEN, "noSKIHandling", new Object[] { "Invalid DER format" } ); } pos++; }
/** * Construct a DERDecoder for the given byte array. * * @param derEncoded the DER-encoded array to decode. * @throws WSSecurityException if the given array is null. */ public DERDecoder(byte[] derEncoded) throws WSSecurityException { if (derEncoded == null) { throw new WSSecurityException( WSSecurityException.UNSUPPORTED_SECURITY_TOKEN, "noSKIHandling", new Object[] { "Invalid DER string" } ); } arr = derEncoded; reset(); }
/** * Confirm that the byte at the current position matches the given value. * * @param val the expected next byte. * @throws WSSecurityException * if the current position is at the end of the array, or if the * byte at the current position doesn't match the expected value. */ public void expect(byte val) throws WSSecurityException { if (!test(val)) { log.debug("DER mismatch: expected " + val + ", got " + arr[pos]); throw new WSSecurityException( WSSecurityException.UNSUPPORTED_SECURITY_TOKEN, "noSKIHandling", new Object[] { "Invalid DER format" } ); } pos++; }
/** * Confirm that the byte at the current position matches the given value. * * @param val the expected next byte. * @throws WSSecurityException * if the current position is at the end of the array, or if the * byte at the current position doesn't match the expected value. */ public void expect(int val) throws WSSecurityException { expect((byte)(val & 0xFF)); }