Java 8 MessageProp - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 MessageProp class.

This code example shows how to use the following methods:
 
    @Override 
    protected void secure_reply(String answer, String code) {
        answer = answer+"\r\n";
        byte[] data = answer.getBytes(UTF8);
        MessageProp prop = new MessageProp(0, false);
        try{ 
            data = _serviceContext.wrap(data, 0, data.length, prop);
        } catch ( GSSException e ) {
            reply("500 Reply encryption error: " + e);
            return; 
        } 
        println(code + " " + Base64.byteArrayToBase64(data));
    } 
 
    @Override 
    public void ftp_auth(String arg) {
        LOGGER.info("GssFtpDoorV1::secure_reply: going to authorize using {}", _gssFlavor);
        if ( !arg.equals("GSSAPI") ) {
            reply("504 Authenticating method not supported"); 
4
CodeRank
This code example shows how to use the following methods:
    LOGGER.info("Reading " + length);
    byte[] data = buffer.readBytes(length);
 
    try { 
      // skip the first 4 bytes which are the length 
      return mContext.getMIC(data, 3, data.length - 4, new MessageProp(false));
    } catch (Exception e) {
      throw new RuntimeException(e);
    } 
 
  } 
 
  @Override 
  protected CompoundResponse doMakeRequest(CompoundRequest request)
      throws IOException {
 
    int sequenceNumber = ++mSequenceNumber;
    RPCBuffer buffer = new RPCBuffer();
    RPCRequest rpcRequest = RPCTestUtil.createRequest();
 
4
CodeRank
This code example shows how to use the following methods:
 
  @Override 
  public synchronized VerifierGSS getVerifer(RPCRequest request) throws RPCException {
    CredentialsGSS creds = (CredentialsGSS)request.getCredentials();
    byte[] sequenceNumber = Bytes.toBytes(creds.getSequenceNum());
    MessageProp msgProp = new MessageProp(false);
    VerifierGSS verifier = new VerifierGSS();
    try { 
      verifier.set(mContext.getMIC(sequenceNumber, 0, sequenceNumber.length, msgProp));
    } catch(GSSException ex) {
      throw new RPCAuthException(RPC_AUTH_STATUS_GSS_CTXPROBLEM, ex);
    } 
    return verifier;
  } 
  public synchronized Pair<? extends Verifier, InitializeResponse> initializeContext(RPCRequest request, RPCBuffer buffer)
    throws RPCException { 
    CredentialsGSS creds = (CredentialsGSS)request.getCredentials();
    Preconditions.checkState((creds.getProcedure() == RPCSEC_GSS_INIT) ||
        (creds.getProcedure() == RPCSEC_GSS_CONTINUE_INIT), "Proc is " + creds.getFlavor());
    Preconditions.checkState(request.getVerifier() instanceof VerifierNone,
4
CodeRank
This code example shows how to use the following methods:
	} 
 
	@Override 
	public byte[] getMIC(byte[] message, int offset, int length) {
		try { 
			return _context.getMIC(message, offset, length, new MessageProp(0, true));
		} catch(GSSException ex) {
			return null; 
		} 
	} 
 
	@Override 
	public void dispose() { 
		try { 
			_context.dispose();
		} catch(GSSException ex) {
			// TODO Error handling? 
		} 
	} 
 
4
CodeRank
This code example shows how to use the following methods:
    } 
  } 
 
  public byte[] getMIC(byte[] message, int s, int l){
    try{ 
      MessageProp prop =  new MessageProp(0, true);
      return context.getMIC(message, s, l, prop);
    } 
    catch(GSSException ex){
      return null; 
    } 
  } 
 
  public void dispose(){ 
    try{ 
      context.dispose();
    } 
    catch(GSSException ex){
    } 
  } 
4
CodeRank
This code example shows how to use the following methods:
    private GSSCredential _userCredential;
    protected GSSName _userPrincipal;
    protected GSSName _myPrincipal;
    protected GSSName _peerPrincipal;
    private boolean _authDone;
    MessageProp _prop =  new MessageProp(true);
    private String _principalStr;
    private boolean _useChannelBinding = true;
 
    protected GssTunnel() {} 
 
    // Creates a new instance of GssTunnel 
    public GssTunnel(String principalStr ) {
    	_principalStr   = principalStr;
    } 
 
    public GssTunnel(String principalStr, boolean init) throws GSSException {
 
 
        if ( init) {
3
CodeRank
See Code Examples for Java 8 MessageProp Methods: