Code example for MessageProp

0
 
    @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");