Package org.ietf.jgss

Examples of org.ietf.jgss.GSSException


            inMsg = new byte[numBytes];
            for (int i = 0; i < numBytes; i++) {
                inMsgTmp.write(inStream.read());
            }
        } catch (IOException e) {
            throw new GSSException(GSSException.FAILURE);
        }
        inMsg = inMsgTmp.toByteArray();

        /* copy input message to gss_buffer_desc for native function */
        if (inMsg != null) {
            gsswrapper.setDescArray(inputMsg, inMsg);
            inputMsg.setLength(inMsg.length);
        }

        /* set default QOP if msgProp is null */
        if (msgProp != null)
            desiredQOP = msgProp.getQOP();

        maj_status = gsswrapper.gss_get_mic(min_status, this.internGSSCtx,
                msgProp.getQOP(), inputMsg, outputMsg);

        if (maj_status != gsswrapper.GSS_S_COMPLETE) {
            throw new GSSExceptionImpl((int) maj_status, (int) min_status[0]);
        }

        /* get the byte[] from our outputMsg, copy back to OutputStream */
        if (outputMsg.getLength() > 0) {
            byte[] temp_msg = new byte[(int) outputMsg.getLength()];
            temp_msg = gsswrapper.getDescArray(outputMsg);
            try {
                outStream.write(temp_msg);
            } catch (IOException e) {
                throw new GSSException(GSSException.FAILURE);
            }
        }

        /* release native structures */
        gsswrapper.gss_release_buffer(min_status, outputMsg);
View Full Code Here


            for (int i = 0; i < numBytes; i++) {
                inMsgTmp.write(msgStream.read());
            }

        } catch (IOException e) {
            throw new GSSException(GSSException.FAILURE);
        }

        inTok = inTokTmp.toByteArray();
        inMsg = inMsgTmp.toByteArray();
View Full Code Here

        throws GSSException {
      
        if (usage != GSSCredential.INITIATE_AND_ACCEPT ||
            usage != GSSCredential.INITIATE_ONLY ||
            usage != GSSCredential.ACCEPT_ONLY) {
            throw new GSSException(GSSException.FAILURE);
        } else {
            GSSCredentialImpl newCred = new GSSCredentialImpl();
            newCred.acquireCred(usage);
            return newCred;
        }
View Full Code Here

       a service provider framework is not supported. RFC 5653 states that a
       service provider framework is optional, and the implementation should
       throw a GSSEXception with GSSException.UNAVAILABLE if not supported. */
    public void addProviderAtFront(Provider p, Oid mech)
        throws GSSException {
            throw new GSSException(GSSException.UNAVAILABLE);
    }
View Full Code Here

            throw new GSSException(GSSException.UNAVAILABLE);
    }

    public void addProviderAtEnd(Provider p, Oid mech)
        throws GSSException {
            throw new GSSException(GSSException.UNAVAILABLE);
    }
View Full Code Here

        int ret = 0;
        gss_name_t_desc name = new gss_name_t_desc();
        gss_OID_set_desc temp_mech_set = new gss_OID_set_desc();
      
        if(invalid) {
            throw new GSSException((int) gsswrapper.GSS_S_DEFECTIVE_CREDENTIAL,
                    0, "credential has been disposed, no longer valid");
        }

        GSSNameImpl tmpName = new GSSNameImpl();
       
View Full Code Here

    }
   
    public GSSName getName(Oid mechOID) throws GSSException {

        if(invalid) {
            throw new GSSException((int)gsswrapper.GSS_S_DEFECTIVE_CREDENTIAL,
                    0, "credential has been disposed, no longer valid");
        }

        GSSName name = getName();
        GSSName canoniName = name.canonicalize(mechOID);
View Full Code Here

        int[] cred_usage = {0};
        gss_name_t_desc name = new gss_name_t_desc();
        gss_OID_set_desc temp_mech_set = new gss_OID_set_desc();
      
        if(invalid) {
            throw new GSSException((int) gsswrapper.GSS_S_DEFECTIVE_CREDENTIAL,
                    0, "credential has been disposed, no longer valid");
        }

        maj_status = gsswrapper.gss_inquire_cred(min_status,
                this.internGSSCred, name, lifetime, cred_usage,
View Full Code Here

        long[] accept_lifetime = {0};
        int[] cred_usage = {0};
        gss_name_t_desc name = new gss_name_t_desc();

        if(invalid) {
            throw new GSSException((int) gsswrapper.GSS_S_DEFECTIVE_CREDENTIAL,
                    0, "credential has been disposed, no longer valid");
        }

        maj_status = gsswrapper.gss_inquire_cred_by_mech(min_status,
                this.internGSSCred, mech.getNativeOid(), name, init_lifetime,
View Full Code Here

        long[] accept_lifetime = {0};
        int[] cred_usage = {0};
        gss_name_t_desc name = new gss_name_t_desc();
       
        if(invalid) {
            throw new GSSException((int) gsswrapper.GSS_S_DEFECTIVE_CREDENTIAL,
                    0, "credential has been disposed, no longer valid");
        }

        maj_status = gsswrapper.gss_inquire_cred_by_mech(min_status,
                this.internGSSCred, mech.getNativeOid(), name, init_lifetime,
View Full Code Here

TOP

Related Classes of org.ietf.jgss.GSSException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.