Java Code Examples for com.alibaba.com.caucho.hessian.io.Hessian2Input#completeEnvelope()
The following examples show how to use
com.alibaba.com.caucho.hessian.io.Hessian2Input#completeEnvelope() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: X509Encryption.java From dubbo-hessian-lite with Apache License 2.0 | 6 votes |
@Override public void close() throws IOException { Hessian2Input in = _in; _in = null; if (in != null) { _cipherIn.close(); _bodyIn.close(); int len = in.readInt(); if (len != 0) throw new IOException("Unexpected footer"); in.completeEnvelope(); in.close(); } }
Example 2
Source File: X509Encryption.java From dubbo3 with Apache License 2.0 | 6 votes |
public void close() throws IOException { Hessian2Input in = _in; _in = null; if (in != null) { _cipherIn.close(); _bodyIn.close(); int len = in.readInt(); if (len != 0) throw new IOException("Unexpected footer"); in.completeEnvelope(); in.close(); } }
Example 3
Source File: X509Signature.java From dubbo-hessian-lite with Apache License 2.0 | 5 votes |
@Override public void close() throws IOException { Hessian2Input in = _in; _in = null; if (in != null) { _bodyIn.close(); int len = in.readInt(); byte[] signature = null; for (int i = 0; i < len; i++) { String header = in.readString(); if ("signature".equals(header)) signature = in.readBytes(); } in.completeEnvelope(); in.close(); if (signature == null) throw new IOException("Expected signature"); byte[] sig = _mac.doFinal(); if (sig.length != signature.length) throw new IOException("mismatched signature"); for (int i = 0; i < sig.length; i++) { if (signature[i] != sig[i]) throw new IOException("mismatched signature"); } // XXX: save principal } }
Example 4
Source File: X509Signature.java From dubbo3 with Apache License 2.0 | 5 votes |
public void close() throws IOException { Hessian2Input in = _in; _in = null; if (in != null) { _bodyIn.close(); int len = in.readInt(); byte[] signature = null; for (int i = 0; i < len; i++) { String header = in.readString(); if ("signature".equals(header)) signature = in.readBytes(); } in.completeEnvelope(); in.close(); if (signature == null) throw new IOException("Expected signature"); byte[] sig = _mac.doFinal(); if (sig.length != signature.length) throw new IOException("mismatched signature"); for (int i = 0; i < sig.length; i++) { if (signature[i] != sig[i]) throw new IOException("mismatched signature"); } // XXX: save principal } }