Java Code Examples for sun.security.util.DerValue#tag_SetOf()
The following examples show how to use
sun.security.util.DerValue#tag_SetOf() .
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: PKCS9Attributes.java From dragonwell8_jdk with GNU General Public License v2.0 | 4 votes |
/** * Decode this set of PKCS9 attributes from the contents of its * DER encoding. Ignores unsupported attributes when directed. * * @param in * the contents of the DER encoding of the attribute set. * * @exception IOException * on i/o error, encoding syntax error, unacceptable or * unsupported attribute, or duplicate attribute. */ private byte[] decode(DerInputStream in) throws IOException { DerValue val = in.getDerValue(); // save the DER encoding with its proper tag byte. byte[] derEncoding = val.toByteArray(); derEncoding[0] = DerValue.tag_SetOf; DerInputStream derIn = new DerInputStream(derEncoding); DerValue[] derVals = derIn.getSet(3,true); PKCS9Attribute attrib; ObjectIdentifier oid; boolean reuseEncoding = true; for (int i=0; i < derVals.length; i++) { try { attrib = new PKCS9Attribute(derVals[i]); } catch (ParsingException e) { if (ignoreUnsupportedAttributes) { reuseEncoding = false; // cannot reuse supplied DER encoding continue; // skip } else { throw e; } } oid = attrib.getOID(); if (attributes.get(oid) != null) throw new IOException("Duplicate PKCS9 attribute: " + oid); if (permittedAttributes != null && !permittedAttributes.containsKey(oid)) throw new IOException("Attribute " + oid + " not permitted in this attribute set"); attributes.put(oid, attrib); } return reuseEncoding ? derEncoding : generateDerEncoding(); }
Example 2
Source File: PKCS9Attributes.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
/** * Decode this set of PKCS9 attributes from the contents of its * DER encoding. Ignores unsupported attributes when directed. * * @param in * the contents of the DER encoding of the attribute set. * * @exception IOException * on i/o error, encoding syntax error, unacceptable or * unsupported attribute, or duplicate attribute. */ private byte[] decode(DerInputStream in) throws IOException { DerValue val = in.getDerValue(); // save the DER encoding with its proper tag byte. byte[] derEncoding = val.toByteArray(); derEncoding[0] = DerValue.tag_SetOf; DerInputStream derIn = new DerInputStream(derEncoding); DerValue[] derVals = derIn.getSet(3,true); PKCS9Attribute attrib; ObjectIdentifier oid; boolean reuseEncoding = true; for (int i=0; i < derVals.length; i++) { try { attrib = new PKCS9Attribute(derVals[i]); } catch (ParsingException e) { if (ignoreUnsupportedAttributes) { reuseEncoding = false; // cannot reuse supplied DER encoding continue; // skip } else { throw e; } } oid = attrib.getOID(); if (attributes.get(oid) != null) throw new IOException("Duplicate PKCS9 attribute: " + oid); if (permittedAttributes != null && !permittedAttributes.containsKey(oid)) throw new IOException("Attribute " + oid + " not permitted in this attribute set"); attributes.put(oid, attrib); } return reuseEncoding ? derEncoding : generateDerEncoding(); }
Example 3
Source File: PKCS9Attributes.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
/** * Decode this set of PKCS9 attributes from the contents of its * DER encoding. Ignores unsupported attributes when directed. * * @param in * the contents of the DER encoding of the attribute set. * * @exception IOException * on i/o error, encoding syntax error, unacceptable or * unsupported attribute, or duplicate attribute. */ private byte[] decode(DerInputStream in) throws IOException { DerValue val = in.getDerValue(); // save the DER encoding with its proper tag byte. byte[] derEncoding = val.toByteArray(); derEncoding[0] = DerValue.tag_SetOf; DerInputStream derIn = new DerInputStream(derEncoding); DerValue[] derVals = derIn.getSet(3,true); PKCS9Attribute attrib; ObjectIdentifier oid; boolean reuseEncoding = true; for (int i=0; i < derVals.length; i++) { try { attrib = new PKCS9Attribute(derVals[i]); } catch (ParsingException e) { if (ignoreUnsupportedAttributes) { reuseEncoding = false; // cannot reuse supplied DER encoding continue; // skip } else { throw e; } } oid = attrib.getOID(); if (attributes.get(oid) != null) throw new IOException("Duplicate PKCS9 attribute: " + oid); if (permittedAttributes != null && !permittedAttributes.containsKey(oid)) throw new IOException("Attribute " + oid + " not permitted in this attribute set"); attributes.put(oid, attrib); } return reuseEncoding ? derEncoding : generateDerEncoding(); }
Example 4
Source File: PKCS9Attributes.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
/** * Decode this set of PKCS9 attributes from the contents of its * DER encoding. Ignores unsupported attributes when directed. * * @param in * the contents of the DER encoding of the attribute set. * * @exception IOException * on i/o error, encoding syntax error, unacceptable or * unsupported attribute, or duplicate attribute. */ private byte[] decode(DerInputStream in) throws IOException { DerValue val = in.getDerValue(); // save the DER encoding with its proper tag byte. byte[] derEncoding = val.toByteArray(); derEncoding[0] = DerValue.tag_SetOf; DerInputStream derIn = new DerInputStream(derEncoding); DerValue[] derVals = derIn.getSet(3,true); PKCS9Attribute attrib; ObjectIdentifier oid; boolean reuseEncoding = true; for (int i=0; i < derVals.length; i++) { try { attrib = new PKCS9Attribute(derVals[i]); } catch (ParsingException e) { if (ignoreUnsupportedAttributes) { reuseEncoding = false; // cannot reuse supplied DER encoding continue; // skip } else { throw e; } } oid = attrib.getOID(); if (attributes.get(oid) != null) throw new IOException("Duplicate PKCS9 attribute: " + oid); if (permittedAttributes != null && !permittedAttributes.containsKey(oid)) throw new IOException("Attribute " + oid + " not permitted in this attribute set"); attributes.put(oid, attrib); } return reuseEncoding ? derEncoding : generateDerEncoding(); }
Example 5
Source File: PKCS9Attributes.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
/** * Decode this set of PKCS9 attributes from the contents of its * DER encoding. Ignores unsupported attributes when directed. * * @param in * the contents of the DER encoding of the attribute set. * * @exception IOException * on i/o error, encoding syntax error, unacceptable or * unsupported attribute, or duplicate attribute. */ private byte[] decode(DerInputStream in) throws IOException { DerValue val = in.getDerValue(); // save the DER encoding with its proper tag byte. byte[] derEncoding = val.toByteArray(); derEncoding[0] = DerValue.tag_SetOf; DerInputStream derIn = new DerInputStream(derEncoding); DerValue[] derVals = derIn.getSet(3,true); PKCS9Attribute attrib; ObjectIdentifier oid; boolean reuseEncoding = true; for (int i=0; i < derVals.length; i++) { try { attrib = new PKCS9Attribute(derVals[i]); } catch (ParsingException e) { if (ignoreUnsupportedAttributes) { reuseEncoding = false; // cannot reuse supplied DER encoding continue; // skip } else { throw e; } } oid = attrib.getOID(); if (attributes.get(oid) != null) throw new IOException("Duplicate PKCS9 attribute: " + oid); if (permittedAttributes != null && !permittedAttributes.containsKey(oid)) throw new IOException("Attribute " + oid + " not permitted in this attribute set"); attributes.put(oid, attrib); } return reuseEncoding ? derEncoding : generateDerEncoding(); }
Example 6
Source File: PKCS9Attributes.java From Bytecoder with Apache License 2.0 | 4 votes |
/** * Decode this set of PKCS9 attributes from the contents of its * DER encoding. Ignores unsupported attributes when directed. * * @param in * the contents of the DER encoding of the attribute set. * * @exception IOException * on i/o error, encoding syntax error, unacceptable or * unsupported attribute, or duplicate attribute. */ private byte[] decode(DerInputStream in) throws IOException { DerValue val = in.getDerValue(); // save the DER encoding with its proper tag byte. byte[] derEncoding = val.toByteArray(); derEncoding[0] = DerValue.tag_SetOf; DerInputStream derIn = new DerInputStream(derEncoding); DerValue[] derVals = derIn.getSet(3,true); PKCS9Attribute attrib; ObjectIdentifier oid; boolean reuseEncoding = true; for (int i=0; i < derVals.length; i++) { try { attrib = new PKCS9Attribute(derVals[i]); } catch (ParsingException e) { if (ignoreUnsupportedAttributes) { reuseEncoding = false; // cannot reuse supplied DER encoding continue; // skip } else { throw e; } } oid = attrib.getOID(); if (attributes.get(oid) != null) throw new IOException("Duplicate PKCS9 attribute: " + oid); if (permittedAttributes != null && !permittedAttributes.containsKey(oid)) throw new IOException("Attribute " + oid + " not permitted in this attribute set"); attributes.put(oid, attrib); } return reuseEncoding ? derEncoding : generateDerEncoding(); }
Example 7
Source File: PKCS9Attributes.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
/** * Decode this set of PKCS9 attributes from the contents of its * DER encoding. Ignores unsupported attributes when directed. * * @param in * the contents of the DER encoding of the attribute set. * * @exception IOException * on i/o error, encoding syntax error, unacceptable or * unsupported attribute, or duplicate attribute. */ private byte[] decode(DerInputStream in) throws IOException { DerValue val = in.getDerValue(); // save the DER encoding with its proper tag byte. byte[] derEncoding = val.toByteArray(); derEncoding[0] = DerValue.tag_SetOf; DerInputStream derIn = new DerInputStream(derEncoding); DerValue[] derVals = derIn.getSet(3,true); PKCS9Attribute attrib; ObjectIdentifier oid; boolean reuseEncoding = true; for (int i=0; i < derVals.length; i++) { try { attrib = new PKCS9Attribute(derVals[i]); } catch (ParsingException e) { if (ignoreUnsupportedAttributes) { reuseEncoding = false; // cannot reuse supplied DER encoding continue; // skip } else { throw e; } } oid = attrib.getOID(); if (attributes.get(oid) != null) throw new IOException("Duplicate PKCS9 attribute: " + oid); if (permittedAttributes != null && !permittedAttributes.containsKey(oid)) throw new IOException("Attribute " + oid + " not permitted in this attribute set"); attributes.put(oid, attrib); } return reuseEncoding ? derEncoding : generateDerEncoding(); }
Example 8
Source File: PKCS9Attributes.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
/** * Decode this set of PKCS9 attributes from the contents of its * DER encoding. Ignores unsupported attributes when directed. * * @param in * the contents of the DER encoding of the attribute set. * * @exception IOException * on i/o error, encoding syntax error, unacceptable or * unsupported attribute, or duplicate attribute. */ private byte[] decode(DerInputStream in) throws IOException { DerValue val = in.getDerValue(); // save the DER encoding with its proper tag byte. byte[] derEncoding = val.toByteArray(); derEncoding[0] = DerValue.tag_SetOf; DerInputStream derIn = new DerInputStream(derEncoding); DerValue[] derVals = derIn.getSet(3,true); PKCS9Attribute attrib; ObjectIdentifier oid; boolean reuseEncoding = true; for (int i=0; i < derVals.length; i++) { try { attrib = new PKCS9Attribute(derVals[i]); } catch (ParsingException e) { if (ignoreUnsupportedAttributes) { reuseEncoding = false; // cannot reuse supplied DER encoding continue; // skip } else { throw e; } } oid = attrib.getOID(); if (attributes.get(oid) != null) throw new IOException("Duplicate PKCS9 attribute: " + oid); if (permittedAttributes != null && !permittedAttributes.containsKey(oid)) throw new IOException("Attribute " + oid + " not permitted in this attribute set"); attributes.put(oid, attrib); } return reuseEncoding ? derEncoding : generateDerEncoding(); }
Example 9
Source File: PKCS9Attributes.java From hottub with GNU General Public License v2.0 | 4 votes |
/** * Decode this set of PKCS9 attributes from the contents of its * DER encoding. Ignores unsupported attributes when directed. * * @param in * the contents of the DER encoding of the attribute set. * * @exception IOException * on i/o error, encoding syntax error, unacceptable or * unsupported attribute, or duplicate attribute. */ private byte[] decode(DerInputStream in) throws IOException { DerValue val = in.getDerValue(); // save the DER encoding with its proper tag byte. byte[] derEncoding = val.toByteArray(); derEncoding[0] = DerValue.tag_SetOf; DerInputStream derIn = new DerInputStream(derEncoding); DerValue[] derVals = derIn.getSet(3,true); PKCS9Attribute attrib; ObjectIdentifier oid; boolean reuseEncoding = true; for (int i=0; i < derVals.length; i++) { try { attrib = new PKCS9Attribute(derVals[i]); } catch (ParsingException e) { if (ignoreUnsupportedAttributes) { reuseEncoding = false; // cannot reuse supplied DER encoding continue; // skip } else { throw e; } } oid = attrib.getOID(); if (attributes.get(oid) != null) throw new IOException("Duplicate PKCS9 attribute: " + oid); if (permittedAttributes != null && !permittedAttributes.containsKey(oid)) throw new IOException("Attribute " + oid + " not permitted in this attribute set"); attributes.put(oid, attrib); } return reuseEncoding ? derEncoding : generateDerEncoding(); }
Example 10
Source File: PKCS9Attributes.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
/** * Decode this set of PKCS9 attributes from the contents of its * DER encoding. Ignores unsupported attributes when directed. * * @param in * the contents of the DER encoding of the attribute set. * * @exception IOException * on i/o error, encoding syntax error, unacceptable or * unsupported attribute, or duplicate attribute. */ private byte[] decode(DerInputStream in) throws IOException { DerValue val = in.getDerValue(); // save the DER encoding with its proper tag byte. byte[] derEncoding = val.toByteArray(); derEncoding[0] = DerValue.tag_SetOf; DerInputStream derIn = new DerInputStream(derEncoding); DerValue[] derVals = derIn.getSet(3,true); PKCS9Attribute attrib; ObjectIdentifier oid; boolean reuseEncoding = true; for (int i=0; i < derVals.length; i++) { try { attrib = new PKCS9Attribute(derVals[i]); } catch (ParsingException e) { if (ignoreUnsupportedAttributes) { reuseEncoding = false; // cannot reuse supplied DER encoding continue; // skip } else { throw e; } } oid = attrib.getOID(); if (attributes.get(oid) != null) throw new IOException("Duplicate PKCS9 attribute: " + oid); if (permittedAttributes != null && !permittedAttributes.containsKey(oid)) throw new IOException("Attribute " + oid + " not permitted in this attribute set"); attributes.put(oid, attrib); } return reuseEncoding ? derEncoding : generateDerEncoding(); }
Example 11
Source File: PKCS9Attributes.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
/** * Decode this set of PKCS9 attributes from the contents of its * DER encoding. Ignores unsupported attributes when directed. * * @param in * the contents of the DER encoding of the attribute set. * * @exception IOException * on i/o error, encoding syntax error, unacceptable or * unsupported attribute, or duplicate attribute. */ private byte[] decode(DerInputStream in) throws IOException { DerValue val = in.getDerValue(); // save the DER encoding with its proper tag byte. byte[] derEncoding = val.toByteArray(); derEncoding[0] = DerValue.tag_SetOf; DerInputStream derIn = new DerInputStream(derEncoding); DerValue[] derVals = derIn.getSet(3,true); PKCS9Attribute attrib; ObjectIdentifier oid; boolean reuseEncoding = true; for (int i=0; i < derVals.length; i++) { try { attrib = new PKCS9Attribute(derVals[i]); } catch (ParsingException e) { if (ignoreUnsupportedAttributes) { reuseEncoding = false; // cannot reuse supplied DER encoding continue; // skip } else { throw e; } } oid = attrib.getOID(); if (attributes.get(oid) != null) throw new IOException("Duplicate PKCS9 attribute: " + oid); if (permittedAttributes != null && !permittedAttributes.containsKey(oid)) throw new IOException("Attribute " + oid + " not permitted in this attribute set"); attributes.put(oid, attrib); } return reuseEncoding ? derEncoding : generateDerEncoding(); }
Example 12
Source File: PKCS9Attributes.java From jdk8u_jdk with GNU General Public License v2.0 | 4 votes |
/** * Decode this set of PKCS9 attributes from the contents of its * DER encoding. Ignores unsupported attributes when directed. * * @param in * the contents of the DER encoding of the attribute set. * * @exception IOException * on i/o error, encoding syntax error, unacceptable or * unsupported attribute, or duplicate attribute. */ private byte[] decode(DerInputStream in) throws IOException { DerValue val = in.getDerValue(); // save the DER encoding with its proper tag byte. byte[] derEncoding = val.toByteArray(); derEncoding[0] = DerValue.tag_SetOf; DerInputStream derIn = new DerInputStream(derEncoding); DerValue[] derVals = derIn.getSet(3,true); PKCS9Attribute attrib; ObjectIdentifier oid; boolean reuseEncoding = true; for (int i=0; i < derVals.length; i++) { try { attrib = new PKCS9Attribute(derVals[i]); } catch (ParsingException e) { if (ignoreUnsupportedAttributes) { reuseEncoding = false; // cannot reuse supplied DER encoding continue; // skip } else { throw e; } } oid = attrib.getOID(); if (attributes.get(oid) != null) throw new IOException("Duplicate PKCS9 attribute: " + oid); if (permittedAttributes != null && !permittedAttributes.containsKey(oid)) throw new IOException("Attribute " + oid + " not permitted in this attribute set"); attributes.put(oid, attrib); } return reuseEncoding ? derEncoding : generateDerEncoding(); }
Example 13
Source File: PKCS9Attributes.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
/** * Decode this set of PKCS9 attributes from the contents of its * DER encoding. Ignores unsupported attributes when directed. * * @param in * the contents of the DER encoding of the attribute set. * * @exception IOException * on i/o error, encoding syntax error, unacceptable or * unsupported attribute, or duplicate attribute. */ private byte[] decode(DerInputStream in) throws IOException { DerValue val = in.getDerValue(); // save the DER encoding with its proper tag byte. byte[] derEncoding = val.toByteArray(); derEncoding[0] = DerValue.tag_SetOf; DerInputStream derIn = new DerInputStream(derEncoding); DerValue[] derVals = derIn.getSet(3,true); PKCS9Attribute attrib; ObjectIdentifier oid; boolean reuseEncoding = true; for (int i=0; i < derVals.length; i++) { try { attrib = new PKCS9Attribute(derVals[i]); } catch (ParsingException e) { if (ignoreUnsupportedAttributes) { reuseEncoding = false; // cannot reuse supplied DER encoding continue; // skip } else { throw e; } } oid = attrib.getOID(); if (attributes.get(oid) != null) throw new IOException("Duplicate PKCS9 attribute: " + oid); if (permittedAttributes != null && !permittedAttributes.containsKey(oid)) throw new IOException("Attribute " + oid + " not permitted in this attribute set"); attributes.put(oid, attrib); } return reuseEncoding ? derEncoding : generateDerEncoding(); }
Example 14
Source File: PKCS9Attributes.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 4 votes |
/** * Decode this set of PKCS9 attributes from the contents of its * DER encoding. Ignores unsupported attributes when directed. * * @param in * the contents of the DER encoding of the attribute set. * * @exception IOException * on i/o error, encoding syntax error, unacceptable or * unsupported attribute, or duplicate attribute. */ private byte[] decode(DerInputStream in) throws IOException { DerValue val = in.getDerValue(); // save the DER encoding with its proper tag byte. byte[] derEncoding = val.toByteArray(); derEncoding[0] = DerValue.tag_SetOf; DerInputStream derIn = new DerInputStream(derEncoding); DerValue[] derVals = derIn.getSet(3,true); PKCS9Attribute attrib; ObjectIdentifier oid; boolean reuseEncoding = true; for (int i=0; i < derVals.length; i++) { try { attrib = new PKCS9Attribute(derVals[i]); } catch (ParsingException e) { if (ignoreUnsupportedAttributes) { reuseEncoding = false; // cannot reuse supplied DER encoding continue; // skip } else { throw e; } } oid = attrib.getOID(); if (attributes.get(oid) != null) throw new IOException("Duplicate PKCS9 attribute: " + oid); if (permittedAttributes != null && !permittedAttributes.containsKey(oid)) throw new IOException("Attribute " + oid + " not permitted in this attribute set"); attributes.put(oid, attrib); } return reuseEncoding ? derEncoding : generateDerEncoding(); }
Example 15
Source File: PKCS9Attributes.java From j2objc with Apache License 2.0 | 4 votes |
/** * Decode this set of PKCS9 attributes from the contents of its * DER encoding. Ignores unsupported attributes when directed. * * @param in * the contents of the DER encoding of the attribute set. * * @exception IOException * on i/o error, encoding syntax error, unacceptable or * unsupported attribute, or duplicate attribute. */ private byte[] decode(DerInputStream in) throws IOException { DerValue val = in.getDerValue(); // save the DER encoding with its proper tag byte. byte[] derEncoding = val.toByteArray(); derEncoding[0] = DerValue.tag_SetOf; DerInputStream derIn = new DerInputStream(derEncoding); DerValue[] derVals = derIn.getSet(3,true); PKCS9Attribute attrib; ObjectIdentifier oid; boolean reuseEncoding = true; for (int i=0; i < derVals.length; i++) { try { attrib = new PKCS9Attribute(derVals[i]); } catch (ParsingException e) { if (ignoreUnsupportedAttributes) { reuseEncoding = false; // cannot reuse supplied DER encoding continue; // skip } else { throw e; } } oid = attrib.getOID(); if (attributes.get(oid) != null) throw new IOException("Duplicate PKCS9 attribute: " + oid); if (permittedAttributes != null && !permittedAttributes.containsKey(oid)) throw new IOException("Attribute " + oid + " not permitted in this attribute set"); attributes.put(oid, attrib); } return reuseEncoding ? derEncoding : generateDerEncoding(); }