类javax.xml.crypto.Data源码实例Demo

下面列出了怎么用javax.xml.crypto.Data的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: dragonwell8_jdk   文件: ValidationTests.java
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
throws URIReferenceException {
    String uri = ref.getURI();
    if (uri.equals(STYLESHEET) || uri.equals(STYLESHEET_B64)) {
        try {
            FileInputStream fis = new FileInputStream(new File
                (DATA_DIR, uri.substring(uri.lastIndexOf('/'))));
            return new OctetStreamData(fis,ref.getURI(),ref.getType());
        } catch (Exception e) { throw new URIReferenceException(e); }
    }

    // fallback on builtin deref
    return defaultUd.dereference(ref, ctx);
}
 
源代码2 项目: dragonwell8_jdk   文件: GenerationTests.java
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
throws URIReferenceException {
    String uri = ref.getURI();
    if (uri.equals(STYLESHEET) || uri.equals(STYLESHEET_B64)) {
        try {
            FileInputStream fis = new FileInputStream(new File
                (DATA_DIR, uri.substring(uri.lastIndexOf('/'))));
            return new OctetStreamData(fis,ref.getURI(),ref.getType());
        } catch (Exception e) { throw new URIReferenceException(e); }
    }

    // fallback on builtin deref
    return defaultUd.dereference(ref, ctx);
}
 
源代码3 项目: TencentKona-8   文件: ValidationTests.java
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
throws URIReferenceException {
    String uri = ref.getURI();
    if (uri.equals(STYLESHEET) || uri.equals(STYLESHEET_B64)) {
        try {
            FileInputStream fis = new FileInputStream(new File
                (DATA_DIR, uri.substring(uri.lastIndexOf('/'))));
            return new OctetStreamData(fis,ref.getURI(),ref.getType());
        } catch (Exception e) { throw new URIReferenceException(e); }
    }

    // fallback on builtin deref
    return defaultUd.dereference(ref, ctx);
}
 
源代码4 项目: TencentKona-8   文件: GenerationTests.java
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
throws URIReferenceException {
    String uri = ref.getURI();
    if (uri.equals(STYLESHEET) || uri.equals(STYLESHEET_B64)) {
        try {
            FileInputStream fis = new FileInputStream(new File
                (DATA_DIR, uri.substring(uri.lastIndexOf('/'))));
            return new OctetStreamData(fis,ref.getURI(),ref.getType());
        } catch (Exception e) { throw new URIReferenceException(e); }
    }

    // fallback on builtin deref
    return defaultUd.dereference(ref, ctx);
}
 
源代码5 项目: jdk8u60   文件: ValidationTests.java
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
throws URIReferenceException {
    String uri = ref.getURI();
    if (uri.equals(STYLESHEET) || uri.equals(STYLESHEET_B64)) {
        try {
            FileInputStream fis = new FileInputStream(new File
                (DATA_DIR, uri.substring(uri.lastIndexOf('/'))));
            return new OctetStreamData(fis,ref.getURI(),ref.getType());
        } catch (Exception e) { throw new URIReferenceException(e); }
    }

    // fallback on builtin deref
    return defaultUd.dereference(ref, ctx);
}
 
源代码6 项目: jdk8u60   文件: GenerationTests.java
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
throws URIReferenceException {
    String uri = ref.getURI();
    if (uri.equals(STYLESHEET) || uri.equals(STYLESHEET_B64)) {
        try {
            FileInputStream fis = new FileInputStream(new File
                (DATA_DIR, uri.substring(uri.lastIndexOf('/'))));
            return new OctetStreamData(fis,ref.getURI(),ref.getType());
        } catch (Exception e) { throw new URIReferenceException(e); }
    }

    // fallback on builtin deref
    return defaultUd.dereference(ref, ctx);
}
 
源代码7 项目: jdk8u_jdk   文件: ValidationTests.java
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
throws URIReferenceException {
    String uri = ref.getURI();
    if (uri.equals(STYLESHEET) || uri.equals(STYLESHEET_B64)) {
        try {
            FileInputStream fis = new FileInputStream(new File
                (DATA_DIR, uri.substring(uri.lastIndexOf('/'))));
            return new OctetStreamData(fis,ref.getURI(),ref.getType());
        } catch (Exception e) { throw new URIReferenceException(e); }
    }

    // fallback on builtin deref
    return defaultUd.dereference(ref, ctx);
}
 
源代码8 项目: openjdk-jdk8u   文件: ValidationTests.java
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
throws URIReferenceException {
    String uri = ref.getURI();
    if (uri.equals(STYLESHEET) || uri.equals(STYLESHEET_B64)) {
        try {
            FileInputStream fis = new FileInputStream(new File
                (DATA_DIR, uri.substring(uri.lastIndexOf('/'))));
            return new OctetStreamData(fis,ref.getURI(),ref.getType());
        } catch (Exception e) { throw new URIReferenceException(e); }
    }

    // fallback on builtin deref
    return defaultUd.dereference(ref, ctx);
}
 
源代码9 项目: openjdk-jdk8u   文件: ErrorHandlerPermissions.java
@Override
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
        throws URIReferenceException {
    // return static content
    return new OctetStreamData(new ByteArrayInputStream(
            "<test>test</test>".getBytes()), ref.getURI(),
            ref.getType());
}
 
源代码10 项目: openjdk-jdk8u   文件: GenerationTests.java
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
throws URIReferenceException {
    String uri = ref.getURI();
    if (uri.equals(STYLESHEET) || uri.equals(STYLESHEET_B64)) {
        try {
            FileInputStream fis = new FileInputStream(new File
                (DATA_DIR, uri.substring(uri.lastIndexOf('/'))));
            return new OctetStreamData(fis,ref.getURI(),ref.getType());
        } catch (Exception e) { throw new URIReferenceException(e); }
    }

    // fallback on builtin deref
    return defaultUd.dereference(ref, ctx);
}
 
源代码11 项目: openjdk-jdk8u-backup   文件: ValidationTests.java
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
throws URIReferenceException {
    String uri = ref.getURI();
    if (uri.equals(STYLESHEET) || uri.equals(STYLESHEET_B64)) {
        try {
            FileInputStream fis = new FileInputStream(new File
                (DATA_DIR, uri.substring(uri.lastIndexOf('/'))));
            return new OctetStreamData(fis,ref.getURI(),ref.getType());
        } catch (Exception e) { throw new URIReferenceException(e); }
    }

    // fallback on builtin deref
    return defaultUd.dereference(ref, ctx);
}
 
源代码12 项目: openjdk-jdk8u-backup   文件: GenerationTests.java
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
throws URIReferenceException {
    String uri = ref.getURI();
    if (uri.equals(STYLESHEET) || uri.equals(STYLESHEET_B64)) {
        try {
            FileInputStream fis = new FileInputStream(new File
                (DATA_DIR, uri.substring(uri.lastIndexOf('/'))));
            return new OctetStreamData(fis,ref.getURI(),ref.getType());
        } catch (Exception e) { throw new URIReferenceException(e); }
    }

    // fallback on builtin deref
    return defaultUd.dereference(ref, ctx);
}
 
源代码13 项目: openjdk-jdk9   文件: ValidationTests.java
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
throws URIReferenceException {
    String uri = ref.getURI();
    if (uri.equals(STYLESHEET) || uri.equals(STYLESHEET_B64)) {
        try {
            FileInputStream fis = new FileInputStream(new File
                (DATA_DIR, uri.substring(uri.lastIndexOf('/'))));
            return new OctetStreamData(fis,ref.getURI(),ref.getType());
        } catch (Exception e) { throw new URIReferenceException(e); }
    }

    // fallback on builtin deref
    return defaultUd.dereference(ref, ctx);
}
 
源代码14 项目: openjdk-jdk9   文件: ErrorHandlerPermissions.java
@Override
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
        throws URIReferenceException {
    // return static content
    return new OctetStreamData(new ByteArrayInputStream(
            "<test>test</test>".getBytes()), ref.getURI(),
            ref.getType());
}
 
源代码15 项目: openjdk-8   文件: ValidationTests.java
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
throws URIReferenceException {
    String uri = ref.getURI();
    if (uri.equals(STYLESHEET) || uri.equals(STYLESHEET_B64)) {
        try {
            FileInputStream fis = new FileInputStream(new File
                (DATA_DIR, uri.substring(uri.lastIndexOf('/'))));
            return new OctetStreamData(fis,ref.getURI(),ref.getType());
        } catch (Exception e) { throw new URIReferenceException(e); }
    }

    // fallback on builtin deref
    return defaultUd.dereference(ref, ctx);
}
 
源代码16 项目: jdk8u_jdk   文件: ErrorHandlerPermissions.java
@Override
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
        throws URIReferenceException {
    // return static content
    return new OctetStreamData(new ByteArrayInputStream(
            "<test>test</test>".getBytes()), ref.getURI(),
            ref.getType());
}
 
源代码17 项目: jdk8u-jdk   文件: GenerationTests.java
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
throws URIReferenceException {
    String uri = ref.getURI();
    if (uri.equals(STYLESHEET) || uri.equals(STYLESHEET_B64)) {
        try {
            FileInputStream fis = new FileInputStream(new File
                (DATA_DIR, uri.substring(uri.lastIndexOf('/'))));
            return new OctetStreamData(fis,ref.getURI(),ref.getType());
        } catch (Exception e) { throw new URIReferenceException(e); }
    }

    // fallback on builtin deref
    return defaultUd.dereference(ref, ctx);
}
 
源代码18 项目: openjdk-8   文件: GenerationTests.java
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
throws URIReferenceException {
    String uri = ref.getURI();
    if (uri.equals(STYLESHEET) || uri.equals(STYLESHEET_B64)) {
        try {
            FileInputStream fis = new FileInputStream(new File
                (DATA_DIR, uri.substring(uri.lastIndexOf('/'))));
            return new OctetStreamData(fis,ref.getURI(),ref.getType());
        } catch (Exception e) { throw new URIReferenceException(e); }
    }

    // fallback on builtin deref
    return defaultUd.dereference(ref, ctx);
}
 
源代码19 项目: jdk8u_jdk   文件: GenerationTests.java
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
throws URIReferenceException {
    String uri = ref.getURI();
    if (uri.equals(STYLESHEET) || uri.equals(STYLESHEET_B64)) {
        try {
            FileInputStream fis = new FileInputStream(new File
                (DATA_DIR, uri.substring(uri.lastIndexOf('/'))));
            return new OctetStreamData(fis,ref.getURI(),ref.getType());
        } catch (Exception e) { throw new URIReferenceException(e); }
    }

    // fallback on builtin deref
    return defaultUd.dereference(ref, ctx);
}
 
源代码20 项目: hottub   文件: GenerationTests.java
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
throws URIReferenceException {
    String uri = ref.getURI();
    if (uri.equals(STYLESHEET) || uri.equals(STYLESHEET_B64)) {
        try {
            FileInputStream fis = new FileInputStream(new File
                (DATA_DIR, uri.substring(uri.lastIndexOf('/'))));
            return new OctetStreamData(fis,ref.getURI(),ref.getType());
        } catch (Exception e) { throw new URIReferenceException(e); }
    }

    // fallback on builtin deref
    return defaultUd.dereference(ref, ctx);
}
 
源代码21 项目: openjdk-8-source   文件: ValidationTests.java
public Data dereference(final URIReference ref, XMLCryptoContext ctx)
throws URIReferenceException {
    String uri = ref.getURI();
    if (uri.equals(STYLESHEET) || uri.equals(STYLESHEET_B64)) {
        try {
            FileInputStream fis = new FileInputStream(new File
                (DATA_DIR, uri.substring(uri.lastIndexOf('/'))));
            return new OctetStreamData(fis,ref.getURI(),ref.getType());
        } catch (Exception e) { throw new URIReferenceException(e); }
    }

    // fallback on builtin deref
    return defaultUd.dereference(ref, ctx);
}
 
源代码22 项目: light-saga-4j   文件: SagaInstanceRepositoryJdbc.java
@Override
public <Data> SagaInstanceData<Data> findWithData(String sagaType, String sagaId) {
  SagaInstance sagaInstance = find(sagaType, sagaId);
  Data sagaData = SagaDataSerde.deserializeSagaData(sagaInstance.getSerializedSagaData());
  return new SagaInstanceData<>(sagaInstance, sagaData);
}
 
/**
 * Creates a <code>Reference</code> with the specified parameters.
 *
 * <p>This method is useful when a list of transforms have already been
 * applied to the <code>Reference</code>. See for example,
 * the
 * <a href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=dss">
 * OASIS-DSS (Digital Signature Services)</a> specification.
 *
 * <p>When an <code>XMLSignature</code> containing this reference is
 * generated, the specified <code>transforms</code> (if non-null) are
 * applied to the specified <code>result</code>. The
 * <code>Transforms</code> element of the resulting <code>Reference</code>
 * element is set to the concatenation of the
 * <code>appliedTransforms</code> and <code>transforms</code>.
 *
 * @param uri the reference URI (may be <code>null</code>)
 * @param dm the digest method
 * @param appliedTransforms a list of {@link Transform}s that have
 *    already been applied. The list is defensively
 *    copied to protect against subsequent modification. The list must
 *    contain at least one entry.
 * @param result the result of processing the sequence of
 *    <code>appliedTransforms</code>
 * @param transforms a list of {@link Transform}s that are to be applied
 *    when generating the signature. The list is defensively copied to
 *    protect against subsequent modification. May be <code>null</code>
 *    or empty.
 * @param type the reference type, as a URI (may be <code>null</code>)
 * @param id the reference ID (may be <code>null</code>)
 * @return a <code>Reference</code>
 * @throws ClassCastException if any of the transforms (in either list)
 *    are not of type <code>Transform</code>
 * @throws IllegalArgumentException if <code>uri</code> is not RFC 2396
 *    compliant or <code>appliedTransforms</code> is empty
 * @throws NullPointerException if <code>dm</code>,
 *    <code>appliedTransforms</code> or <code>result</code> is
 *    <code>null</code>
 */
@SuppressWarnings("rawtypes")
public abstract Reference newReference(String uri, DigestMethod dm,
    List appliedTransforms, Data result, List transforms, String type,
    String id);
 
源代码24 项目: jdk1.8-source-analysis   文件: Reference.java
/**
 * Returns the dereferenced data, if
 * <a href="XMLSignContext.html#Supported Properties">reference caching</a>
 * is enabled. This is the result of dereferencing the URI of this
 * reference during a validation or generation operation.
 *
 * @return the dereferenced data, or <code>null</code> if reference
 *    caching is not enabled or this reference has not been generated or
 *    validated
 */
Data getDereferencedData();
 
源代码25 项目: jdk1.8-source-analysis   文件: Transform.java
/**
 * Transforms the specified data using the underlying transform algorithm.
 *
 * @param data the data to be transformed
 * @param context the <code>XMLCryptoContext</code> containing
 *    additional context (may be <code>null</code> if not applicable)
 * @return the transformed data
 * @throws NullPointerException if <code>data</code> is <code>null</code>
 * @throws TransformException if an error occurs while executing the
 *    transform
 */
public abstract Data transform(Data data, XMLCryptoContext context)
    throws TransformException;
 
源代码26 项目: jdk8u_jdk   文件: RetrievalMethod.java
/**
* Dereferences the <code>KeyInfo</code> information referenced by this
* <code>RetrievalMethod</code> and applies the specified
* <code>Transform</code>s.
*
* @param context an <code>XMLCryptoContext</code> that may contain
*    additional useful information for dereferencing the URI. The
*    context's <code>baseURI</code> and <code>dereferencer</code>
*    parameters (if specified) are used to resolve and dereference this
*    <code>RetrievalMethod</code>
* @return a <code>Data</code> object representing the raw contents of the
*    <code>KeyInfo</code> information referenced by this
*    <code>RetrievalMethod</code>. It is the caller's responsibility to
*    convert the returned data to an appropriate
*    <code>KeyInfo</code> object.
* @throws NullPointerException if <code>context</code> is <code>null</code>
* @throws URIReferenceException if there is an error while dereferencing
*/
Data dereference(XMLCryptoContext context) throws URIReferenceException;
 
源代码27 项目: jdk1.8-source-analysis   文件: RetrievalMethod.java
/**
* Dereferences the <code>KeyInfo</code> information referenced by this
* <code>RetrievalMethod</code> and applies the specified
* <code>Transform</code>s.
*
* @param context an <code>XMLCryptoContext</code> that may contain
*    additional useful information for dereferencing the URI. The
*    context's <code>baseURI</code> and <code>dereferencer</code>
*    parameters (if specified) are used to resolve and dereference this
*    <code>RetrievalMethod</code>
* @return a <code>Data</code> object representing the raw contents of the
*    <code>KeyInfo</code> information referenced by this
*    <code>RetrievalMethod</code>. It is the caller's responsibility to
*    convert the returned data to an appropriate
*    <code>KeyInfo</code> object.
* @throws NullPointerException if <code>context</code> is <code>null</code>
* @throws URIReferenceException if there is an error while dereferencing
*/
Data dereference(XMLCryptoContext context) throws URIReferenceException;
 
源代码28 项目: dragonwell8_jdk   文件: XMLSignatureFactory.java
/**
 * Creates a <code>Reference</code> with the specified parameters.
 *
 * <p>This method is useful when a list of transforms have already been
 * applied to the <code>Reference</code>. See for example,
 * the
 * <a href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=dss">
 * OASIS-DSS (Digital Signature Services)</a> specification.
 *
 * <p>When an <code>XMLSignature</code> containing this reference is
 * generated, the specified <code>transforms</code> (if non-null) are
 * applied to the specified <code>result</code>. The
 * <code>Transforms</code> element of the resulting <code>Reference</code>
 * element is set to the concatenation of the
 * <code>appliedTransforms</code> and <code>transforms</code>.
 *
 * @param uri the reference URI (may be <code>null</code>)
 * @param dm the digest method
 * @param appliedTransforms a list of {@link Transform}s that have
 *    already been applied. The list is defensively
 *    copied to protect against subsequent modification. The list must
 *    contain at least one entry.
 * @param result the result of processing the sequence of
 *    <code>appliedTransforms</code>
 * @param transforms a list of {@link Transform}s that are to be applied
 *    when generating the signature. The list is defensively copied to
 *    protect against subsequent modification. May be <code>null</code>
 *    or empty.
 * @param type the reference type, as a URI (may be <code>null</code>)
 * @param id the reference ID (may be <code>null</code>)
 * @return a <code>Reference</code>
 * @throws ClassCastException if any of the transforms (in either list)
 *    are not of type <code>Transform</code>
 * @throws IllegalArgumentException if <code>uri</code> is not RFC 2396
 *    compliant or <code>appliedTransforms</code> is empty
 * @throws NullPointerException if <code>dm</code>,
 *    <code>appliedTransforms</code> or <code>result</code> is
 *    <code>null</code>
 */
@SuppressWarnings("rawtypes")
public abstract Reference newReference(String uri, DigestMethod dm,
    List appliedTransforms, Data result, List transforms, String type,
    String id);
 
源代码29 项目: jdk8u_jdk   文件: XMLSignatureFactory.java
/**
 * Creates a <code>Reference</code> with the specified parameters.
 *
 * <p>This method is useful when a list of transforms have already been
 * applied to the <code>Reference</code>. See for example,
 * the
 * <a href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=dss">
 * OASIS-DSS (Digital Signature Services)</a> specification.
 *
 * <p>When an <code>XMLSignature</code> containing this reference is
 * generated, the specified <code>transforms</code> (if non-null) are
 * applied to the specified <code>result</code>. The
 * <code>Transforms</code> element of the resulting <code>Reference</code>
 * element is set to the concatenation of the
 * <code>appliedTransforms</code> and <code>transforms</code>.
 *
 * @param uri the reference URI (may be <code>null</code>)
 * @param dm the digest method
 * @param appliedTransforms a list of {@link Transform}s that have
 *    already been applied. The list is defensively
 *    copied to protect against subsequent modification. The list must
 *    contain at least one entry.
 * @param result the result of processing the sequence of
 *    <code>appliedTransforms</code>
 * @param transforms a list of {@link Transform}s that are to be applied
 *    when generating the signature. The list is defensively copied to
 *    protect against subsequent modification. May be <code>null</code>
 *    or empty.
 * @param type the reference type, as a URI (may be <code>null</code>)
 * @param id the reference ID (may be <code>null</code>)
 * @return a <code>Reference</code>
 * @throws ClassCastException if any of the transforms (in either list)
 *    are not of type <code>Transform</code>
 * @throws IllegalArgumentException if <code>uri</code> is not RFC 2396
 *    compliant or <code>appliedTransforms</code> is empty
 * @throws NullPointerException if <code>dm</code>,
 *    <code>appliedTransforms</code> or <code>result</code> is
 *    <code>null</code>
 */
@SuppressWarnings("rawtypes")
public abstract Reference newReference(String uri, DigestMethod dm,
    List appliedTransforms, Data result, List transforms, String type,
    String id);
 
源代码30 项目: dragonwell8_jdk   文件: Transform.java
/**
 * Transforms the specified data using the underlying transform algorithm.
 *
 * @param data the data to be transformed
 * @param context the <code>XMLCryptoContext</code> containing
 *    additional context (may be <code>null</code> if not applicable)
 * @return the transformed data
 * @throws NullPointerException if <code>data</code> is <code>null</code>
 * @throws TransformException if an error occurs while executing the
 *    transform
 */
public abstract Data transform(Data data, XMLCryptoContext context)
    throws TransformException;