Java Code Examples for sun.security.util.DerValue#createTag()

The following examples show how to use sun.security.util.DerValue#createTag() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ResponderId.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Convert the responderKeyId data member into its DER-encoded form
 *
 * @return the DER encoding for a responder ID byKey option, including
 *      explicit context-specific tagging.
 *
 * @throws IOException if any encoding error occurs
 */
private byte[] keyIdToBytes() throws IOException {
    // Place the KeyIdentifier bytes into an OCTET STRING
    DerValue inner = new DerValue(DerValue.tag_OctetString,
            responderKeyId.getIdentifier());

    // Mark the OCTET STRING-wrapped KeyIdentifier bytes
    // as EXPLICIT CONTEXT 2
    DerValue outer = new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT,
            true, (byte)Type.BY_KEY.value()), inner.toByteArray());

    return outer.toByteArray();
}
 
Example 2
Source File: ResponderId.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Convert the responderKeyId data member into its DER-encoded form
 *
 * @return the DER encoding for a responder ID byKey option, including
 *      explicit context-specific tagging.
 *
 * @throws IOException if any encoding error occurs
 */
private byte[] keyIdToBytes() throws IOException {
    // Place the KeyIdentifier bytes into an OCTET STRING
    DerValue inner = new DerValue(DerValue.tag_OctetString,
            responderKeyId.getIdentifier());

    // Mark the OCTET STRING-wrapped KeyIdentifier bytes
    // as EXPLICIT CONTEXT 2
    DerValue outer = new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT,
            true, (byte)Type.BY_KEY.value()), inner.toByteArray());

    return outer.toByteArray();
}
 
Example 3
Source File: ResponderId.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Convert the responderKeyId data member into its DER-encoded form
 *
 * @return the DER encoding for a responder ID byKey option, including
 *      explicit context-specific tagging.
 *
 * @throws IOException if any encoding error occurs
 */
private byte[] keyIdToBytes() throws IOException {
    // Place the KeyIdentifier bytes into an OCTET STRING
    DerValue inner = new DerValue(DerValue.tag_OctetString,
            responderKeyId.getIdentifier());

    // Mark the OCTET STRING-wrapped KeyIdentifier bytes
    // as EXPLICIT CONTEXT 2
    DerValue outer = new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT,
            true, (byte)Type.BY_KEY.value()), inner.toByteArray());

    return outer.toByteArray();
}
 
Example 4
Source File: ResponderId.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Convert the responderKeyId data member into its DER-encoded form
 *
 * @return the DER encoding for a responder ID byKey option, including
 *      explicit context-specific tagging.
 *
 * @throws IOException if any encoding error occurs
 */
private byte[] keyIdToBytes() throws IOException {
    // Place the KeyIdentifier bytes into an OCTET STRING
    DerValue inner = new DerValue(DerValue.tag_OctetString,
            responderKeyId.getIdentifier());

    // Mark the OCTET STRING-wrapped KeyIdentifier bytes
    // as EXPLICIT CONTEXT 2
    DerValue outer = new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT,
            true, (byte)Type.BY_KEY.value()), inner.toByteArray());

    return outer.toByteArray();
}
 
Example 5
Source File: ResponderId.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Convert the responderKeyId data member into its DER-encoded form
 *
 * @return the DER encoding for a responder ID byKey option, including
 *      explicit context-specific tagging.
 *
 * @throws IOException if any encoding error occurs
 */
private byte[] keyIdToBytes() throws IOException {
    // Place the KeyIdentifier bytes into an OCTET STRING
    DerValue inner = new DerValue(DerValue.tag_OctetString,
            responderKeyId.getIdentifier());

    // Mark the OCTET STRING-wrapped KeyIdentifier bytes
    // as EXPLICIT CONTEXT 2
    DerValue outer = new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT,
            true, (byte)Type.BY_KEY.value()), inner.toByteArray());

    return outer.toByteArray();
}
 
Example 6
Source File: ResponderId.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Convert the responderKeyId data member into its DER-encoded form
 *
 * @return the DER encoding for a responder ID byKey option, including
 *      explicit context-specific tagging.
 *
 * @throws IOException if any encoding error occurs
 */
private byte[] keyIdToBytes() throws IOException {
    // Place the KeyIdentifier bytes into an OCTET STRING
    DerValue inner = new DerValue(DerValue.tag_OctetString,
            responderKeyId.getIdentifier());

    // Mark the OCTET STRING-wrapped KeyIdentifier bytes
    // as EXPLICIT CONTEXT 2
    DerValue outer = new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT,
            true, (byte)Type.BY_KEY.value()), inner.toByteArray());

    return outer.toByteArray();
}
 
Example 7
Source File: ResponderId.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Convert the responderKeyId data member into its DER-encoded form
 *
 * @return the DER encoding for a responder ID byKey option, including
 *      explicit context-specific tagging.
 *
 * @throws IOException if any encoding error occurs
 */
private byte[] keyIdToBytes() throws IOException {
    // Place the KeyIdentifier bytes into an OCTET STRING
    DerValue inner = new DerValue(DerValue.tag_OctetString,
            responderKeyId.getIdentifier());

    // Mark the OCTET STRING-wrapped KeyIdentifier bytes
    // as EXPLICIT CONTEXT 2
    DerValue outer = new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT,
            true, (byte)Type.BY_KEY.value()), inner.toByteArray());

    return outer.toByteArray();
}
 
Example 8
Source File: ResponderId.java    From dragonwell8_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Convert the responderName data member into its DER-encoded form
 *
 * @return the DER encoding for a responder ID byName option, including
 *      explicit context-specific tagging.
 *
 * @throws IOException if any encoding error occurs
 */
private byte[] principalToBytes() throws IOException {
    DerValue dv = new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT,
            true, (byte)Type.BY_NAME.value()),
            responderName.getEncoded());
    return dv.toByteArray();
}
 
Example 9
Source File: ResponderId.java    From TencentKona-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Convert the responderName data member into its DER-encoded form
 *
 * @return the DER encoding for a responder ID byName option, including
 *      explicit context-specific tagging.
 *
 * @throws IOException if any encoding error occurs
 */
private byte[] principalToBytes() throws IOException {
    DerValue dv = new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT,
            true, (byte)Type.BY_NAME.value()),
            responderName.getEncoded());
    return dv.toByteArray();
}
 
Example 10
Source File: ResponderId.java    From openjdk-jdk8u with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Convert the responderName data member into its DER-encoded form
 *
 * @return the DER encoding for a responder ID byName option, including
 *      explicit context-specific tagging.
 *
 * @throws IOException if any encoding error occurs
 */
private byte[] principalToBytes() throws IOException {
    DerValue dv = new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT,
            true, (byte)Type.BY_NAME.value()),
            responderName.getEncoded());
    return dv.toByteArray();
}
 
Example 11
Source File: ResponderId.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Convert the responderName data member into its DER-encoded form
 *
 * @return the DER encoding for a responder ID byName option, including
 *      explicit context-specific tagging.
 *
 * @throws IOException if any encoding error occurs
 */
private byte[] principalToBytes() throws IOException {
    DerValue dv = new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT,
            true, (byte)Type.BY_NAME.value()),
            responderName.getEncoded());
    return dv.toByteArray();
}
 
Example 12
Source File: ResponderId.java    From Bytecoder with Apache License 2.0 3 votes vote down vote up
/**
 * Convert the responderName data member into its DER-encoded form
 *
 * @return the DER encoding for a responder ID byName option, including
 *      explicit context-specific tagging.
 *
 * @throws IOException if any encoding error occurs
 */
private byte[] principalToBytes() throws IOException {
    DerValue dv = new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT,
            true, (byte)Type.BY_NAME.value()),
            responderName.getEncoded());
    return dv.toByteArray();
}
 
Example 13
Source File: ResponderId.java    From openjdk-jdk9 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Convert the responderName data member into its DER-encoded form
 *
 * @return the DER encoding for a responder ID byName option, including
 *      explicit context-specific tagging.
 *
 * @throws IOException if any encoding error occurs
 */
private byte[] principalToBytes() throws IOException {
    DerValue dv = new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT,
            true, (byte)Type.BY_NAME.value()),
            responderName.getEncoded());
    return dv.toByteArray();
}
 
Example 14
Source File: ResponderId.java    From jdk8u_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Convert the responderName data member into its DER-encoded form
 *
 * @return the DER encoding for a responder ID byName option, including
 *      explicit context-specific tagging.
 *
 * @throws IOException if any encoding error occurs
 */
private byte[] principalToBytes() throws IOException {
    DerValue dv = new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT,
            true, (byte)Type.BY_NAME.value()),
            responderName.getEncoded());
    return dv.toByteArray();
}