Package jcifs.spnego.asn1

Examples of jcifs.spnego.asn1.DERInputStream


    }

    private static byte[] encoded = new byte[] { 0x01, 0x03, 0x11, 0x13, 0x15 };

    public void testDecode() throws IOException {
        DerInputStream in = new DerInputStream(encoded);
        assertTrue(Arrays.equals(encoded, (byte[]) ASN1Any.getInstance()
                .decode(in)));
    }
View Full Code Here


        this.ticket = ticket;
        this.encPart = encPart;
    }

    public void decrypt(SecretKey key) throws IOException {
        DerInputStream in = new DerInputStream(new ByteArrayInputStream(encPart
                .decrypt(key)));

        Object[] values = (Object[]) ENC_AS_REP_PART.decode(in);

        this.key = (EncryptionKey) values[0];
View Full Code Here

                socket.receive(resp);

                bytesRead = resp.getLength();
                out.write(buf, resp.getOffset(), bytesRead);
            }
            DerInputStream in = new DerInputStream(out.toByteArray());

            if (in.tag == KDCReply.AS_REP_ASN1.constrId) { //TODO AS reply
                KDCReply reply = (KDCReply) KDCReply.AS_REP_ASN1.decode(in);

                KerberosKey key = new KerberosKey(new KerberosPrincipal(cname
View Full Code Here

     * @param encoding - ASN.1 DER encoding
     * @throws IOException - if encoding is wrong
     */
    public Name(byte[] encoding) throws IOException {

        DerInputStream in = new DerInputStream(encoding);

        if (in.getEndOffset() != encoding.length) {
            throw new IOException(Messages.getString("security.111")); //$NON-NLS-1$
        }

        ASN1.decode(in);

View Full Code Here

     * @param encoding - ASN.1 DER encoding
     * @throws IOException - if encoding is wrong
     */
    public Name(byte[] encoding) throws IOException {

        DerInputStream in = new DerInputStream(encoding);

        if (in.getEndOffset() != encoding.length) {
            throw new IOException(Messages.getString("security.111")); //$NON-NLS-1$
        }

        ASN1.decode(in);

View Full Code Here

        this.hexString = hexString;
        this.encoded = encoded;

        try {
            DerInputStream in = new DerInputStream(encoded);

            tag = in.tag;

            if (DirectoryString.ASN1.checkTag(tag)) {
                // has string representation
View Full Code Here

                socket.receive(resp);

                bytesRead = resp.getLength();
                out.write(buf, resp.getOffset(), bytesRead);
            }
            DerInputStream in = new DerInputStream(out.toByteArray());

            if (in.tag == KDCReply.AS_REP_ASN1.constrId) { //TODO AS reply
                KDCReply reply = (KDCReply) KDCReply.AS_REP_ASN1.decode(in);

                KerberosKey key = new KerberosKey(new KerberosPrincipal(cname
View Full Code Here

public class KerberosErrorMessageTest extends TestCase {

    public void test_Ctor() throws IOException {

        KerberosErrorMessage message = KerberosErrorMessage
                .decode(new DerInputStream(err_resp));

        assertEquals("ctime", new Date(1000), message.getCtime());
        assertEquals("cusec", 65536, message.getCusec());

        assertEquals("stime", new Date(0), message.getStime());
View Full Code Here

     * @param encoding - ASN.1 DER encoding
     * @throws IOException - if encoding is wrong
     */
    public Name(byte[] encoding) throws IOException {

        DerInputStream in = new DerInputStream(encoding);

        if (in.getEndOffset() != encoding.length) {
            throw new IOException(Messages.getString("security.111")); //$NON-NLS-1$
        }

        ASN1.decode(in);

View Full Code Here

        this.hexString = hexString;
        this.encoded = encoded;

        try {
            DerInputStream in = new DerInputStream(encoded);

            tag = in.tag;

            if (DirectoryString.ASN1.checkTag(tag)) {
                // has string representation
View Full Code Here

TOP

Related Classes of jcifs.spnego.asn1.DERInputStream

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.