Package sun.security.krb5.internal.ccache

Examples of sun.security.krb5.internal.ccache.CredentialsCache


     */
    public ETypeInfo(DerValue encoding) throws Asn1Exception, IOException {
        DerValue der = null;

        if (encoding.getTag() != DerValue.tag_Sequence) {
            throw new Asn1Exception(Krb5.ASN1_BAD_ID);
        }

        // etype
        der = encoding.getData().getDerValue();
        if ((der.getTag() & 0x1F) == 0x00) {
            this.etype = der.getData().getBigInteger().intValue();
        }
        else
            throw new Asn1Exception(Krb5.ASN1_BAD_ID);

        // salt
        if (encoding.getData().available() > 0) {
            der = encoding.getData().getDerValue();
            if ((der.getTag() & 0x1F) == 0x01) {
                this.salt = der.getData().getOctetString();
            }
        }

        if (encoding.getData().available() > 0)
            throw new Asn1Exception(Krb5.ASN1_BAD_ID);
    }
View Full Code Here


                KrbApErrException, IOException {

                if (((encoding.getTag() & (byte)(0x1F)) != Krb5.KRB_AP_REP)
             || (encoding.isApplication() != true)
                        || (encoding.isConstructed() != true))
                        throw new Asn1Exception(Krb5.ASN1_BAD_ID);
                DerValue der = encoding.getData().getDerValue();
        if (der.getTag() != DerValue.tag_Sequence)
            throw new Asn1Exception(Krb5.ASN1_BAD_ID);
                DerValue subDer = der.getData().getDerValue();
                if ((subDer.getTag() & (byte)0x1F) != (byte)0x00)
            throw new Asn1Exception(Krb5.ASN1_BAD_ID);
        pvno = subDer.getData().getBigInteger().intValue();
        if (pvno != Krb5.PVNO)
                                throw new KrbApErrException(Krb5.KRB_AP_ERR_BADVERSION);
                subDer = der.getData().getDerValue();
                if ((subDer.getTag() & (byte)0x1F) != (byte)0x01)
            throw new Asn1Exception(Krb5.ASN1_BAD_ID);
                msgType = subDer.getData().getBigInteger().intValue();
                if (msgType != Krb5.KRB_AP_REP)
                                throw new KrbApErrException(Krb5.KRB_AP_ERR_MSG_TYPE);
                encPart = EncryptedData.parse(der.getData(), (byte)0x02, false);
                if (der.getData().available() > 0)
            throw new Asn1Exception(Krb5.ASN1_BAD_ID);
        }
View Full Code Here

     * @exception Asn1Exception if an error occurs while decoding an ASN1 encoded data.
     * @exception IOException if an I/O error occurs while reading encoded data.
     */
    public LastReqEntry(DerValue encoding) throws Asn1Exception, IOException {
        if (encoding.getTag() != DerValue.tag_Sequence) {
            throw new Asn1Exception(Krb5.ASN1_BAD_ID);
        }
        DerValue der;
        der = encoding.getData().getDerValue();
        if ((der.getTag() & 0x1F) == 0x00){
            lrType = der.getData().getBigInteger().intValue();
        }
        else
            throw new Asn1Exception(Krb5.ASN1_BAD_ID);

        lrValue = KerberosTime.parse(encoding.getData(), (byte)0x01, false);
        if (encoding.getData().available() > 0)
            throw new Asn1Exception(Krb5.ASN1_BAD_ID);
    }
View Full Code Here

    RealmException, KrbApErrException, IOException {
        DerValue der, subDer;
        if (((encoding.getTag() & (byte)0x1F) != (byte)0x14)
            || (encoding.isApplication() != true)
            || (encoding.isConstructed() != true))
            throw new Asn1Exception(Krb5.ASN1_BAD_ID);
        der = encoding.getData().getDerValue();
        if (der.getTag() != DerValue.tag_Sequence)
            throw new Asn1Exception(Krb5.ASN1_BAD_ID);
        subDer = der.getData().getDerValue();
        if ((subDer.getTag() & 0x1F) == 0x00) {
            pvno = subDer.getData().getBigInteger().intValue();
            if (pvno != Krb5.PVNO)
                throw new KrbApErrException(Krb5.KRB_AP_ERR_BADVERSION);
        }
        else
            throw new Asn1Exception(Krb5.ASN1_BAD_ID);
        subDer = der.getData().getDerValue();
        if ((subDer.getTag() & 0x1F) == 0x01) {
            msgType = subDer.getData().getBigInteger().intValue();
            if (msgType != Krb5.KRB_SAFE)
                throw new KrbApErrException(Krb5.KRB_AP_ERR_MSG_TYPE);
        }

        else
            throw new Asn1Exception(Krb5.ASN1_BAD_ID);
        safeBody = KRBSafeBody.parse(der.getData(), (byte)0x02, false);
        cksum = Checksum.parse(der.getData(), (byte)0x03, false);
        if (der.getData().available() > 0)
            throw new Asn1Exception(Krb5.ASN1_BAD_ID);
    }
View Full Code Here

        set(oneBit, true);
    }
    public APOptions(int size, byte[] data) throws Asn1Exception {
        super(size, data);
        if ((size > data.length * BITS_PER_UNIT) || (size > Krb5.AP_OPTS_MAX + 1)) {
            throw new Asn1Exception(Krb5.BITSTRING_BAD_LENGTH);
        }
    }
View Full Code Here

    }

    public APOptions(boolean[] data) throws Asn1Exception {
        super(data);
        if (data.length > Krb5.AP_OPTS_MAX + 1) {
            throw new Asn1Exception(Krb5.BITSTRING_BAD_LENGTH);
        }
    }
View Full Code Here

    public static APOptions parse(DerInputStream data, byte explicitTag, boolean optional) throws Asn1Exception, IOException {
        if ((optional) && (((byte)data.peekByte() & (byte)0x1F) != explicitTag))
            return null;
        DerValue der = data.getDerValue();
        if (explicitTag != (der.getTag() & (byte)0x1F))  {
            throw new Asn1Exception(Krb5.ASN1_BAD_ID);
        } else {
            DerValue subDer = der.getData().getDerValue();
            return new APOptions(subDer);
        }
    }
View Full Code Here

        private void init(DerValue encoding) throws Asn1Exception,
                RealmException, KrbApErrException, IOException {
        if (((encoding.getTag() & (byte)0x1F) != (byte)0x16)
                        || (encoding.isApplication() != true)
                        || (encoding.isConstructed() != true))
                        throw new Asn1Exception(Krb5.ASN1_BAD_ID);
        DerValue der, subDer;
                der = encoding.getData().getDerValue();
                if (der.getTag() != DerValue.tag_Sequence)
                        throw new Asn1Exception(Krb5.ASN1_BAD_ID);
                subDer = der.getData().getDerValue();
            if ((subDer.getTag() & 0x1F) == 0x00) {
                        pvno = subDer.getData().getBigInteger().intValue();
                        if (pvno != Krb5.PVNO) {
                throw new KrbApErrException(Krb5.KRB_AP_ERR_BADVERSION);
                        }
                }
        else
                        throw new Asn1Exception(Krb5.ASN1_BAD_ID);
                subDer = der.getData().getDerValue();
                if ((subDer.getTag() & 0x1F) == 0x01) {
                        msgType = subDer.getData().getBigInteger().intValue();
            if (msgType != Krb5.KRB_CRED)
                throw new KrbApErrException(Krb5.KRB_AP_ERR_MSG_TYPE);
                }
                else
                        throw new Asn1Exception(Krb5.ASN1_BAD_ID);
        subDer = der.getData().getDerValue();
                if ((subDer.getTag() & 0x1F) == 0x02) {
                        DerValue subsubDer = subDer.getData().getDerValue();
            if (subsubDer.getTag() != DerValue.tag_SequenceOf) {
                                throw new Asn1Exception(Krb5.ASN1_BAD_ID);
                        }
            Vector<Ticket> v = new Vector<Ticket> ();
            while (subsubDer.getData().available() > 0) {
                                v.addElement(new Ticket(subsubDer.getData().getDerValue()));
                        }
            if (v.size() > 0) {
                                tickets = new Ticket[v.size()];
                                v.copyInto(tickets);
                        }
                }
                else
                        throw new Asn1Exception(Krb5.ASN1_BAD_ID);
                encPart = EncryptedData.parse(der.getData(), (byte)0x03, false);

                if (der.getData().available() > 0)
                        throw new Asn1Exception(Krb5.ASN1_BAD_ID);
        }
View Full Code Here

     * @exception IOException if an I/O error occurs while reading encoded data.
     */
    public KRBSafeBody(DerValue encoding) throws Asn1Exception, IOException {
        DerValue der;
        if (encoding.getTag() != DerValue.tag_Sequence) {
            throw new Asn1Exception(Krb5.ASN1_BAD_ID);
        }
        der = encoding.getData().getDerValue();
        if ((der.getTag() & 0x1F) == 0x00) {
            userData = der.getData().getOctetString();
        }
        else
            throw new Asn1Exception(Krb5.ASN1_BAD_ID);
        timestamp = KerberosTime.parse(encoding.getData(), (byte)0x01, true);
        if ((encoding.getData().peekByte() & 0x1F) == 0x02) {
            der = encoding.getData().getDerValue();
            usec = new Integer(der.getData().getBigInteger().intValue());
        }
        if ((encoding.getData().peekByte() & 0x1F) == 0x03) {
            der = encoding.getData().getDerValue();
            seqNumber = new Integer(der.getData().getBigInteger().intValue());
        }
        sAddress = HostAddress.parse(encoding.getData(), (byte)0x04, false);
        if (encoding.getData().available() > 0)
            rAddress = HostAddress.parse(encoding.getData(), (byte)0x05, true);
        if (encoding.getData().available() > 0)
            throw new Asn1Exception(Krb5.ASN1_BAD_ID);
    }
View Full Code Here

    public static KRBSafeBody parse(DerInputStream data, byte explicitTag, boolean optional) throws Asn1Exception, IOException {
        if ((optional) && (((byte)data.peekByte() & (byte)0x1F) != explicitTag))
            return null;
        DerValue der = data.getDerValue();
        if (explicitTag != (der.getTag() & (byte)0x1F))
            throw new Asn1Exception(Krb5.ASN1_BAD_ID);
        else {
            DerValue subDer = der.getData().getDerValue();
            return new KRBSafeBody(subDer);
        }
    }
View Full Code Here

TOP

Related Classes of sun.security.krb5.internal.ccache.CredentialsCache

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.