/** * Decodes an OID and resolve its corresponding key algorithm. * * @return the key algorithm associated with the OID or null if no algorithm could be resolved */ public String decodeObjectIdentifierAsKeyAlgorithm() { return keyAlgorithmFromOid(decodeObjectIdentifier()); }
/** * <p> * Create an {@code OtherName} that is defined as: * * <pre> * OtherName ::= SEQUENCE { * type-id OBJECT IDENTIFIER, * value [0] EXPLICIT ANY DEFINED BY type-id } * </pre> * </p> * * @param encodedName the DER encoded form of the name, as a byte array * @throws ASN1Exception if {@code encodedName} is not DER encoded */ public OtherName(final byte[] encodedName) throws ASN1Exception { super(OTHER_NAME); this.encodedName = encodedName; final DERDecoder decoder = new DERDecoder(encodedName); decoder.startSequence(); typeId = decoder.decodeObjectIdentifier(); encodedValue = decoder.drainElement(); decoder.endSequence(); }
decoder.decodeImplicit(APPLICATION_SPECIFIC_MASK, 0); decoder.startSequence(); String decodedOid = decoder.decodeObjectIdentifier(); if (! mechanism.equals(new Oid(decodedOid))) { throw new GSSException(GSSException.DEFECTIVE_TOKEN);
decoder.decodeImplicit(generalNameType); decoder.startSequence(); String typeId = decoder.decodeObjectIdentifier(); byte[] encodedValue = decoder.drainElement(); decoder.endSequence(); if (decoder.isNextType(CONTEXT_SPECIFIC_MASK, generalNameType, false)) { decoder.decodeImplicit(generalNameType); generalName = new RegisteredID(decoder.decodeObjectIdentifier()); break out;
/** * Decodes an OID and resolve its corresponding key algorithm. * * @return the key algorithm associated with the OID or null if no algorithm could be resolved */ public String decodeObjectIdentifierAsKeyAlgorithm() { return keyAlgorithmFromOid(decodeObjectIdentifier()); }
/** * Decodes an OID and resolve its corresponding key algorithm. * * @return the key algorithm associated with the OID or null if no algorithm could be resolved */ public String decodeObjectIdentifierAsKeyAlgorithm() { return keyAlgorithmFromOid(decodeObjectIdentifier()); }
/** * Decodes an OID and resolve its corresponding key algorithm. * * @return the key algorithm associated with the OID or null if no algorithm could be resolved */ public String decodeObjectIdentifierAsKeyAlgorithm() { return keyAlgorithmFromOid(decodeObjectIdentifier()); }
/** * <p> * Create an {@code OtherName} that is defined as: * * <pre> * OtherName ::= SEQUENCE { * type-id OBJECT IDENTIFIER, * value [0] EXPLICIT ANY DEFINED BY type-id } * </pre> * </p> * * @param encodedName the DER encoded form of the name, as a byte array * @throws ASN1Exception if {@code encodedName} is not DER encoded */ public OtherName(final byte[] encodedName) throws ASN1Exception { super(OTHER_NAME); this.encodedName = encodedName; final DERDecoder decoder = new DERDecoder(encodedName); decoder.startSequence(); typeId = decoder.decodeObjectIdentifier(); encodedValue = decoder.drainElement(); decoder.endSequence(); }
/** * <p> * Create an {@code OtherName} that is defined as: * * <pre> * OtherName ::= SEQUENCE { * type-id OBJECT IDENTIFIER, * value [0] EXPLICIT ANY DEFINED BY type-id } * </pre> * </p> * * @param encodedName the DER encoded form of the name, as a byte array * @throws ASN1Exception if {@code encodedName} is not DER encoded */ public OtherName(final byte[] encodedName) throws ASN1Exception { super(OTHER_NAME); this.encodedName = encodedName; final DERDecoder decoder = new DERDecoder(encodedName); decoder.startSequence(); typeId = decoder.decodeObjectIdentifier(); encodedValue = decoder.drainElement(); decoder.endSequence(); }
/** * <p> * Create an {@code OtherName} that is defined as: * * <pre> * OtherName ::= SEQUENCE { * type-id OBJECT IDENTIFIER, * value [0] EXPLICIT ANY DEFINED BY type-id } * </pre> * </p> * * @param encodedName the DER encoded form of the name, as a byte array * @throws ASN1Exception if {@code encodedName} is not DER encoded */ public OtherName(final byte[] encodedName) throws ASN1Exception { super(OTHER_NAME); this.encodedName = encodedName; final DERDecoder decoder = new DERDecoder(encodedName); decoder.startSequence(); typeId = decoder.decodeObjectIdentifier(); encodedValue = decoder.drainElement(); decoder.endSequence(); }
decoder.decodeImplicit(generalNameType); decoder.startSequence(); String typeId = decoder.decodeObjectIdentifier(); byte[] encodedValue = decoder.drainElement(); decoder.endSequence(); if (decoder.isNextType(CONTEXT_SPECIFIC_MASK, generalNameType, false)) { decoder.decodeImplicit(generalNameType); generalName = new RegisteredID(decoder.decodeObjectIdentifier()); break out;
decoder.decodeImplicit(generalNameType); decoder.startSequence(); String typeId = decoder.decodeObjectIdentifier(); byte[] encodedValue = decoder.drainElement(); decoder.endSequence(); if (decoder.isNextType(CONTEXT_SPECIFIC_MASK, generalNameType, false)) { decoder.decodeImplicit(generalNameType); generalName = new RegisteredID(decoder.decodeObjectIdentifier()); break out;
decoder.decodeImplicit(APPLICATION_SPECIFIC_MASK, 0); decoder.startSequence(); String decodedOid = decoder.decodeObjectIdentifier(); if (! mechanism.equals(new Oid(decodedOid))) { throw new GSSException(GSSException.DEFECTIVE_TOKEN);
decoder.decodeImplicit(APPLICATION_SPECIFIC_MASK, 0); decoder.startSequence(); String decodedOid = decoder.decodeObjectIdentifier(); if (! mechanism.equals(new Oid(decodedOid))) { throw new GSSException(GSSException.DEFECTIVE_TOKEN);
decoder.decodeImplicit(generalNameType); decoder.startSequence(); String typeId = decoder.decodeObjectIdentifier(); byte[] encodedValue = decoder.drainElement(); decoder.endSequence(); if (decoder.isNextType(CONTEXT_SPECIFIC_MASK, generalNameType, false)) { decoder.decodeImplicit(generalNameType); generalName = new RegisteredID(decoder.decodeObjectIdentifier()); break out;
decoder.decodeImplicit(APPLICATION_SPECIFIC_MASK, 0); decoder.startSequence(); String decodedOid = decoder.decodeObjectIdentifier(); if (! mechanism.equals(new Oid(decodedOid))) { throw new GSSException(GSSException.DEFECTIVE_TOKEN);