Java 8 GSSException - 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 GSSException class.

This code example shows how to use the following methods:getMajor, getMajorString, getMinor, getMinorString
      int length = buffer.readUint32();
      mToken = buffer.readBytes(length);
      try { 
        mToken = mContext.acceptSecContext(mToken, 0, mToken.length);
      } catch (GSSException e) {
        LOGGER.warn("Error on accept: major = " + e.getMajor() +
            ", minor = " + e.getMinor() + ", major = " + e.getMajorString() +
            ", minor = " + e.getMinorString(), e);
        InitializeResponse initResponse = new InitializeResponse();
        initResponse.setContextID(null);
        initResponse.setMajorErrorCode(e.getMajor());
        initResponse.setMinorErrorCode(e.getMinor());
        initResponse.setSequenceWindow(RPCSEC_GSS_SEQUENCE_WINDOW);
        initResponse.setToken(null);
        return Pair.of(new VerifierNone(), initResponse);
      } 
      if(mToken == null) {
        mToken = new byte[0];
      } 
      String msg = "Initializing context: Reading token " + length +
5
CodeRank
This code example shows how to use the following methods:getMessage
            //debug("GssFtpDoorV1::ftp_adat: Token created"); 
            _gssIdentity = _serviceContext.getSrcName();
            //debug("GssFtpDoorV1::ftp_adat: User principal: " + UserPrincipal); 
        } catch (GSSException e) {
            CertPathValidatorException cpve =
                    getFirst(filter(Throwables.getCausalChain(e), CertPathValidatorException.class), null);
            if (cpve != null && cpve.getCertPath() != null && LOGGER.isDebugEnabled()) {
                LOGGER.error("Authentication failed: {} in #{} of {}", 
                        e.getMessage(), cpve.getIndex() + 1, cpve.getCertPath());
            } else { 
                LOGGER.error("Authentication failed: {}", e.getMessage());
            } 
	    LOGGER.trace("Authentication failed", e);
            reply("535 Authentication failed: " + e.getMessage());
            return; 
        } 
        if (token != null) {
            if (!_serviceContext.isEstablished()) {
                reply("335 ADAT="+Base64.byteArrayToBase64(token));
            } 
5
CodeRank
This code example shows how to use the following methods:
   * @param response byte[] 
   */ 
  public NegTokenTarg(int result, Oid mech, byte[] response) {
 
    m_result = result;
    m_supportedMech = mech;
    m_responseToken = response;
  } 
 
  /** 
   * Return the result 
   *  
   * @return int 
   */ 
  public final int getResult() { 
    return m_result;
  } 
 
  /** 
   * Return the supported mech type Oid 
3
CodeRank
This code example shows how to use the following methods:
    public String getSchemeName() { 
        return "Negotiate"; 
    } 
 
    /** 
     * Produces SPNEGO authorization Header based on token created by 
     * processChallenge. 
     * 
     * @param credentials not used by the SPNEGO scheme. 
     * @param request The request being authenticated 
     * 
     * @throws AuthenticationException if authentication string cannot 
     *   be generated due to an authentication failure 
     * 
     * @return SPNEGO authentication Header 
     */ 
    @Override 
    public Header authenticate( 
            final Credentials credentials, 
            final HttpRequest request, 
3
CodeRank
This code example shows how to use the following methods:
        return "Kerberos"; 
    } 
 
    /** 
     * Produces KERBEROS authorization Header based on token created by 
     * processChallenge. 
     * 
     * @param credentials not used by the KERBEROS scheme. 
     * @param request The request being authenticated 
     * 
     * @throws AuthenticationException if authentication string cannot 
     *   be generated due to an authentication failure 
     * 
     * @return KERBEROS authentication Header 
     */ 
    @Override 
    public Header authenticate( 
            final Credentials credentials, 
            final HttpRequest request, 
            final HttpContext context) throws AuthenticationException { 
3
CodeRank
This code example shows how to use the following methods:
 *  License. 
 * 
 *  The Original Code is ISO_OID.java 
 * 
 *  The Initial Developer of the Original Code is Rong Chen. 
 *  Portions created by the Initial Developer are Copyright (C) 2003-2004 
 *  the Initial Developer. All Rights Reserved. 
 * 
 *  Contributor(s): 
 * 
 * Software distributed under the License is distributed on an 'AS IS' basis, 
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
 * for the specific language governing rights and limitations under the 
 * License. 
 * 
 *  ***** END LICENSE BLOCK ***** 
 */ 
3
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
	public void addProviderAtFront(Provider p, Oid mech) throws GSSException {
		enumApisFromProvider(p, mech, true);
	} 
 
	@Override 
	public GSSContext createContext(byte[] interProcessToken)
			throws GSSException {
		// TODO Auto-generated method stub 
		return null; 
	} 
 
	@Override 
	public GSSContext createContext(GSSCredential myCred) throws GSSException {
		// TODO Auto-generated method stub 
		return null; 
	} 
 
	@Override 
	public GSSContext createContext(GSSName peer, Oid mech,
			GSSCredential myCred, int lifetime) throws GSSException {
4
CodeRank
This code example shows how to use the following methods:
      SPNEGO = new Oid(ID_SPNEGO); 
 
      KERBEROS5 = new Oid(ID_KERBEROS5); 
      MSKERBEROS5 = new Oid(ID_MSKERBEROS5); 
      KRB5USERTOUSER = new Oid(ID_KRB5USERTOUSER); 
       
      NTLMSSP = new Oid(ID_NTLMSSP); 
    } 
    catch (GSSException ex) { 
    } 
  } 
} 
4
CodeRank
This code example shows how to use the following methods:
   * @param response byte[] 
   */ 
  public NegTokenTarg(int result, Oid mech, byte[] response) {
 
    m_result = result;
    m_supportedMech = mech;
    m_responseToken = response;
  } 
 
  /** 
   * Return the result 
   *  
   * @return int 
   */ 
  public final int getResult() { 
    return m_result;
  } 
 
  /** 
   * Return the supported mech type Oid 
4
CodeRank
See Code Examples for Java 8 GSSException Methods: