java.security.interfaces.DSAKey#com.sun.org.apache.xml.internal.security.utils.JavaUtils源码实例Demo

下面列出了java.security.interfaces.DSAKey#com.sun.org.apache.xml.internal.security.utils.JavaUtils 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: jdk8u-jdk   文件: SignatureAlgorithm.java
/**
 * Registers implementing class of the Transform algorithm with algorithmURI
 *
 * @param algorithmURI algorithmURI URI representation of <code>SignatureAlgorithm</code>.
 * @param implementingClass <code>implementingClass</code> the implementing class of
 * {@link SignatureAlgorithmSpi}
 * @throws AlgorithmAlreadyRegisteredException if specified algorithmURI is already registered
 * @throws XMLSignatureException
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register the signature algorithm
 */
public static void register(String algorithmURI, Class<? extends SignatureAlgorithmSpi> implementingClass)
   throws AlgorithmAlreadyRegisteredException, ClassNotFoundException,
       XMLSignatureException {
    JavaUtils.checkRegisterPermission();
    if (log.isLoggable(java.util.logging.Level.FINE)) {
        log.log(java.util.logging.Level.FINE, "Try to register " + algorithmURI + " " + implementingClass);
    }

    // are we already registered?
    Class<? extends SignatureAlgorithmSpi> registeredClass = algorithmHash.get(algorithmURI);
    if (registeredClass != null) {
        Object exArgs[] = { algorithmURI, registeredClass };
        throw new AlgorithmAlreadyRegisteredException(
            "algorithm.alreadyRegistered", exArgs
        );
    }
    algorithmHash.put(algorithmURI, implementingClass);
}
 
源代码2 项目: dragonwell8_jdk   文件: Transform.java
/**
 * Registers implementing class of the Transform algorithm with algorithmURI
 *
 * @param algorithmURI algorithmURI URI representation of <code>Transform algorithm</code>
 * @param implementingClass <code>implementingClass</code> the implementing
 * class of {@link TransformSpi}
 * @throws AlgorithmAlreadyRegisteredException if specified algorithmURI
 * is already registered
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register the transform
 */
@SuppressWarnings("unchecked")
public static void register(String algorithmURI, String implementingClass)
    throws AlgorithmAlreadyRegisteredException, ClassNotFoundException,
        InvalidTransformException {
    JavaUtils.checkRegisterPermission();
    // are we already registered?
    Class<? extends TransformSpi> transformSpi = transformSpiHash.get(algorithmURI);
    if (transformSpi != null) {
        Object exArgs[] = { algorithmURI, transformSpi };
        throw new AlgorithmAlreadyRegisteredException("algorithm.alreadyRegistered", exArgs);
    }
    Class<? extends TransformSpi> transformSpiClass =
        (Class<? extends TransformSpi>)
            ClassLoaderUtils.loadClass(implementingClass, Transform.class);
    transformSpiHash.put(algorithmURI, transformSpiClass);
}
 
源代码3 项目: hottub   文件: Transform.java
/**
 * Registers implementing class of the Transform algorithm with algorithmURI
 *
 * @param algorithmURI algorithmURI URI representation of <code>Transform algorithm</code>
 * @param implementingClass <code>implementingClass</code> the implementing
 * class of {@link TransformSpi}
 * @throws AlgorithmAlreadyRegisteredException if specified algorithmURI
 * is already registered
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register the transform
 */
@SuppressWarnings("unchecked")
public static void register(String algorithmURI, String implementingClass)
    throws AlgorithmAlreadyRegisteredException, ClassNotFoundException,
        InvalidTransformException {
    JavaUtils.checkRegisterPermission();
    // are we already registered?
    Class<? extends TransformSpi> transformSpi = transformSpiHash.get(algorithmURI);
    if (transformSpi != null) {
        Object exArgs[] = { algorithmURI, transformSpi };
        throw new AlgorithmAlreadyRegisteredException("algorithm.alreadyRegistered", exArgs);
    }
    Class<? extends TransformSpi> transformSpiClass =
        (Class<? extends TransformSpi>)
            ClassLoaderUtils.loadClass(implementingClass, Transform.class);
    transformSpiHash.put(algorithmURI, transformSpiClass);
}
 
源代码4 项目: TencentKona-8   文件: Transform.java
/**
 * Registers implementing class of the Transform algorithm with algorithmURI
 *
 * @param algorithmURI algorithmURI URI representation of <code>Transform algorithm</code>
 * @param implementingClass <code>implementingClass</code> the implementing
 * class of {@link TransformSpi}
 * @throws AlgorithmAlreadyRegisteredException if specified algorithmURI
 * is already registered
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register the transform
 */
@SuppressWarnings("unchecked")
public static void register(String algorithmURI, String implementingClass)
    throws AlgorithmAlreadyRegisteredException, ClassNotFoundException,
        InvalidTransformException {
    JavaUtils.checkRegisterPermission();
    // are we already registered?
    Class<? extends TransformSpi> transformSpi = transformSpiHash.get(algorithmURI);
    if (transformSpi != null) {
        Object exArgs[] = { algorithmURI, transformSpi };
        throw new AlgorithmAlreadyRegisteredException("algorithm.alreadyRegistered", exArgs);
    }
    Class<? extends TransformSpi> transformSpiClass =
        (Class<? extends TransformSpi>)
            ClassLoaderUtils.loadClass(implementingClass, Transform.class);
    transformSpiHash.put(algorithmURI, transformSpiClass);
}
 
源代码5 项目: hottub   文件: Canonicalizer.java
/**
 * Method register
 *
 * @param algorithmURI
 * @param implementingClass
 * @throws AlgorithmAlreadyRegisteredException
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register the canonicalizer
 */
@SuppressWarnings("unchecked")
public static void register(String algorithmURI, String implementingClass)
    throws AlgorithmAlreadyRegisteredException, ClassNotFoundException {
    JavaUtils.checkRegisterPermission();
    // check whether URI is already registered
    Class<? extends CanonicalizerSpi> registeredClass =
        canonicalizerHash.get(algorithmURI);

    if (registeredClass != null)  {
        Object exArgs[] = { algorithmURI, registeredClass };
        throw new AlgorithmAlreadyRegisteredException("algorithm.alreadyRegistered", exArgs);
    }

    canonicalizerHash.put(
        algorithmURI, (Class<? extends CanonicalizerSpi>)Class.forName(implementingClass)
    );
}
 
源代码6 项目: openjdk-jdk9   文件: Canonicalizer.java
/**
 * Method register
 *
 * @param algorithmURI
 * @param implementingClass
 * @throws AlgorithmAlreadyRegisteredException
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register the canonicalizer
 */
@SuppressWarnings("unchecked")
public static void register(String algorithmURI, String implementingClass)
    throws AlgorithmAlreadyRegisteredException, ClassNotFoundException {
    JavaUtils.checkRegisterPermission();
    // check whether URI is already registered
    Class<? extends CanonicalizerSpi> registeredClass =
        canonicalizerHash.get(algorithmURI);

    if (registeredClass != null)  {
        Object exArgs[] = { algorithmURI, registeredClass };
        throw new AlgorithmAlreadyRegisteredException("algorithm.alreadyRegistered", exArgs);
    }

    canonicalizerHash.put(
        algorithmURI, (Class<? extends CanonicalizerSpi>)Class.forName(implementingClass)
    );
}
 
源代码7 项目: TencentKona-8   文件: SignatureAlgorithm.java
/**
 * Registers implementing class of the Transform algorithm with algorithmURI
 *
 * @param algorithmURI algorithmURI URI representation of <code>SignatureAlgorithm</code>.
 * @param implementingClass <code>implementingClass</code> the implementing class of
 * {@link SignatureAlgorithmSpi}
 * @throws AlgorithmAlreadyRegisteredException if specified algorithmURI is already registered
 * @throws XMLSignatureException
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register the signature algorithm
 */
public static void register(String algorithmURI, Class<? extends SignatureAlgorithmSpi> implementingClass)
   throws AlgorithmAlreadyRegisteredException, ClassNotFoundException,
       XMLSignatureException {
    JavaUtils.checkRegisterPermission();
    if (log.isLoggable(java.util.logging.Level.FINE)) {
        log.log(java.util.logging.Level.FINE, "Try to register " + algorithmURI + " " + implementingClass);
    }

    // are we already registered?
    Class<? extends SignatureAlgorithmSpi> registeredClass = algorithmHash.get(algorithmURI);
    if (registeredClass != null) {
        Object exArgs[] = { algorithmURI, registeredClass };
        throw new AlgorithmAlreadyRegisteredException(
            "algorithm.alreadyRegistered", exArgs
        );
    }
    algorithmHash.put(algorithmURI, implementingClass);
}
 
源代码8 项目: jdk8u60   文件: SignatureAlgorithm.java
/**
 * Registers implementing class of the Transform algorithm with algorithmURI
 *
 * @param algorithmURI algorithmURI URI representation of <code>SignatureAlgorithm</code>.
 * @param implementingClass <code>implementingClass</code> the implementing class of
 * {@link SignatureAlgorithmSpi}
 * @throws AlgorithmAlreadyRegisteredException if specified algorithmURI is already registered
 * @throws XMLSignatureException
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register the signature algorithm
 */
public static void register(String algorithmURI, Class<? extends SignatureAlgorithmSpi> implementingClass)
   throws AlgorithmAlreadyRegisteredException, ClassNotFoundException,
       XMLSignatureException {
    JavaUtils.checkRegisterPermission();
    if (log.isLoggable(java.util.logging.Level.FINE)) {
        log.log(java.util.logging.Level.FINE, "Try to register " + algorithmURI + " " + implementingClass);
    }

    // are we already registered?
    Class<? extends SignatureAlgorithmSpi> registeredClass = algorithmHash.get(algorithmURI);
    if (registeredClass != null) {
        Object exArgs[] = { algorithmURI, registeredClass };
        throw new AlgorithmAlreadyRegisteredException(
            "algorithm.alreadyRegistered", exArgs
        );
    }
    algorithmHash.put(algorithmURI, implementingClass);
}
 
源代码9 项目: jdk8u_jdk   文件: SignatureAlgorithm.java
/**
 * Registers implementing class of the Transform algorithm with algorithmURI
 *
 * @param algorithmURI algorithmURI URI representation of <code>SignatureAlgorithm</code>.
 * @param implementingClass <code>implementingClass</code> the implementing class of
 * {@link SignatureAlgorithmSpi}
 * @throws AlgorithmAlreadyRegisteredException if specified algorithmURI is already registered
 * @throws XMLSignatureException
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register the signature algorithm
 */
public static void register(String algorithmURI, Class<? extends SignatureAlgorithmSpi> implementingClass)
   throws AlgorithmAlreadyRegisteredException, ClassNotFoundException,
       XMLSignatureException {
    JavaUtils.checkRegisterPermission();
    if (log.isLoggable(java.util.logging.Level.FINE)) {
        log.log(java.util.logging.Level.FINE, "Try to register " + algorithmURI + " " + implementingClass);
    }

    // are we already registered?
    Class<? extends SignatureAlgorithmSpi> registeredClass = algorithmHash.get(algorithmURI);
    if (registeredClass != null) {
        Object exArgs[] = { algorithmURI, registeredClass };
        throw new AlgorithmAlreadyRegisteredException(
            "algorithm.alreadyRegistered", exArgs
        );
    }
    algorithmHash.put(algorithmURI, implementingClass);
}
 
源代码10 项目: jdk8u-dev-jdk   文件: Canonicalizer.java
/**
 * Method register
 *
 * @param algorithmURI
 * @param implementingClass
 * @throws AlgorithmAlreadyRegisteredException
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register the canonicalizer
 */
@SuppressWarnings("unchecked")
public static void register(String algorithmURI, String implementingClass)
    throws AlgorithmAlreadyRegisteredException, ClassNotFoundException {
    JavaUtils.checkRegisterPermission();
    // check whether URI is already registered
    Class<? extends CanonicalizerSpi> registeredClass =
        canonicalizerHash.get(algorithmURI);

    if (registeredClass != null)  {
        Object exArgs[] = { algorithmURI, registeredClass };
        throw new AlgorithmAlreadyRegisteredException("algorithm.alreadyRegistered", exArgs);
    }

    canonicalizerHash.put(
        algorithmURI, (Class<? extends CanonicalizerSpi>)Class.forName(implementingClass)
    );
}
 
源代码11 项目: openjdk-jdk8u   文件: SignatureAlgorithm.java
/**
 * Registers implementing class of the Transform algorithm with algorithmURI
 *
 * @param algorithmURI algorithmURI URI representation of <code>SignatureAlgorithm</code>.
 * @param implementingClass <code>implementingClass</code> the implementing class of
 * {@link SignatureAlgorithmSpi}
 * @throws AlgorithmAlreadyRegisteredException if specified algorithmURI is already registered
 * @throws XMLSignatureException
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register the signature algorithm
 */
public static void register(String algorithmURI, Class<? extends SignatureAlgorithmSpi> implementingClass)
   throws AlgorithmAlreadyRegisteredException, ClassNotFoundException,
       XMLSignatureException {
    JavaUtils.checkRegisterPermission();
    if (log.isLoggable(java.util.logging.Level.FINE)) {
        log.log(java.util.logging.Level.FINE, "Try to register " + algorithmURI + " " + implementingClass);
    }

    // are we already registered?
    Class<? extends SignatureAlgorithmSpi> registeredClass = algorithmHash.get(algorithmURI);
    if (registeredClass != null) {
        Object exArgs[] = { algorithmURI, registeredClass };
        throw new AlgorithmAlreadyRegisteredException(
            "algorithm.alreadyRegistered", exArgs
        );
    }
    algorithmHash.put(algorithmURI, implementingClass);
}
 
源代码12 项目: hottub   文件: SignatureAlgorithm.java
/**
 * Registers implementing class of the Transform algorithm with algorithmURI
 *
 * @param algorithmURI algorithmURI URI representation of <code>SignatureAlgorithm</code>.
 * @param implementingClass <code>implementingClass</code> the implementing class of
 * {@link SignatureAlgorithmSpi}
 * @throws AlgorithmAlreadyRegisteredException if specified algorithmURI is already registered
 * @throws XMLSignatureException
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register the signature algorithm
 */
public static void register(String algorithmURI, Class<? extends SignatureAlgorithmSpi> implementingClass)
   throws AlgorithmAlreadyRegisteredException, ClassNotFoundException,
       XMLSignatureException {
    JavaUtils.checkRegisterPermission();
    if (log.isLoggable(java.util.logging.Level.FINE)) {
        log.log(java.util.logging.Level.FINE, "Try to register " + algorithmURI + " " + implementingClass);
    }

    // are we already registered?
    Class<? extends SignatureAlgorithmSpi> registeredClass = algorithmHash.get(algorithmURI);
    if (registeredClass != null) {
        Object exArgs[] = { algorithmURI, registeredClass };
        throw new AlgorithmAlreadyRegisteredException(
            "algorithm.alreadyRegistered", exArgs
        );
    }
    algorithmHash.put(algorithmURI, implementingClass);
}
 
源代码13 项目: jdk1.8-source-analysis   文件: ResourceResolver.java
/**
 * Registers a ResourceResolverSpi class. This method logs a warning if
 * the class cannot be registered.
 *
 * @param className the name of the ResourceResolverSpi class to be registered
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register a resource resolver
 */
@SuppressWarnings("unchecked")
public static void register(String className) {
    JavaUtils.checkRegisterPermission();
    try {
        Class<ResourceResolverSpi> resourceResolverClass =
            (Class<ResourceResolverSpi>) Class.forName(className);
        register(resourceResolverClass, false);
    } catch (ClassNotFoundException e) {
        log.log(java.util.logging.Level.WARNING, "Error loading resolver " + className + " disabling it");
    }
}
 
源代码14 项目: hottub   文件: XMLSignatureInput.java
private byte[] getBytesFromInputStream() throws IOException {
    if (bytes != null) {
        return bytes;
    }
    if (inputOctetStreamProxy == null) {
        return null;
    }
    try {
        bytes = JavaUtils.getBytesFromStream(inputOctetStreamProxy);
    } finally {
        inputOctetStreamProxy.close();
    }
    return bytes;
}
 
源代码15 项目: jdk1.8-source-analysis   文件: ResourceResolver.java
/**
 * Registers a ResourceResolverSpi instance. This method logs a warning if the class
 * cannot be registered.
 * @param resourceResolverSpi
 * @param start
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register a resource resolver
 */
public static void register(ResourceResolverSpi resourceResolverSpi, boolean start) {
    JavaUtils.checkRegisterPermission();
    synchronized(resolverList) {
        if (start) {
            resolverList.add(0, new ResourceResolver(resourceResolverSpi));
        } else {
            resolverList.add(new ResourceResolver(resourceResolverSpi));
        }
    }
    if (log.isLoggable(java.util.logging.Level.FINE)) {
        log.log(java.util.logging.Level.FINE, "Registered resolver: " + resourceResolverSpi.toString());
    }
}
 
源代码16 项目: jdk1.8-source-analysis   文件: XMLSignatureInput.java
private byte[] getBytesFromInputStream() throws IOException {
    if (bytes != null) {
        return bytes;
    }
    if (inputOctetStreamProxy == null) {
        return null;
    }
    try {
        bytes = JavaUtils.getBytesFromStream(inputOctetStreamProxy);
    } finally {
        inputOctetStreamProxy.close();
    }
    return bytes;
}
 
源代码17 项目: jdk8u_jdk   文件: Canonicalizer.java
/**
 * Method register
 *
 * @param algorithmURI
 * @param implementingClass
 * @throws AlgorithmAlreadyRegisteredException
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register the canonicalizer
 */
public static void register(String algorithmURI, Class<? extends CanonicalizerSpi> implementingClass)
    throws AlgorithmAlreadyRegisteredException, ClassNotFoundException {
    JavaUtils.checkRegisterPermission();
    // check whether URI is already registered
    Class<? extends CanonicalizerSpi> registeredClass = canonicalizerHash.get(algorithmURI);

    if (registeredClass != null)  {
        Object exArgs[] = { algorithmURI, registeredClass };
        throw new AlgorithmAlreadyRegisteredException("algorithm.alreadyRegistered", exArgs);
    }

    canonicalizerHash.put(algorithmURI, implementingClass);
}
 
源代码18 项目: jdk1.8-source-analysis   文件: Canonicalizer.java
/**
 * Method register
 *
 * @param algorithmURI
 * @param implementingClass
 * @throws AlgorithmAlreadyRegisteredException
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register the canonicalizer
 */
public static void register(String algorithmURI, Class<? extends CanonicalizerSpi> implementingClass)
    throws AlgorithmAlreadyRegisteredException, ClassNotFoundException {
    JavaUtils.checkRegisterPermission();
    // check whether URI is already registered
    Class<? extends CanonicalizerSpi> registeredClass = canonicalizerHash.get(algorithmURI);

    if (registeredClass != null)  {
        Object exArgs[] = { algorithmURI, registeredClass };
        throw new AlgorithmAlreadyRegisteredException("algorithm.alreadyRegistered", exArgs);
    }

    canonicalizerHash.put(algorithmURI, implementingClass);
}
 
源代码19 项目: openjdk-jdk9   文件: DOMSignatureMethod.java
@Override
byte[] preVerifyFormat(Key key, byte[] sig) throws IOException {
    // If signature needs to be in ASN.1 (i.e., if the fallback
    // algorithm will be used to verify the sig), convert the signature
    // to the ASN.1 format
    if (asn1) {
        int size = ((DSAKey) key).getParams().getQ().bitLength();
        return JavaUtils.convertDsaXMLDSIGtoASN1(sig, size / 8);
    } else {
        return sig;
    }
}
 
源代码20 项目: openjdk-jdk8u   文件: Canonicalizer.java
/**
 * Method register
 *
 * @param algorithmURI
 * @param implementingClass
 * @throws AlgorithmAlreadyRegisteredException
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register the canonicalizer
 */
public static void register(String algorithmURI, Class<? extends CanonicalizerSpi> implementingClass)
    throws AlgorithmAlreadyRegisteredException, ClassNotFoundException {
    JavaUtils.checkRegisterPermission();
    // check whether URI is already registered
    Class<? extends CanonicalizerSpi> registeredClass = canonicalizerHash.get(algorithmURI);

    if (registeredClass != null)  {
        Object exArgs[] = { algorithmURI, registeredClass };
        throw new AlgorithmAlreadyRegisteredException("algorithm.alreadyRegistered", exArgs);
    }

    canonicalizerHash.put(algorithmURI, implementingClass);
}
 
源代码21 项目: dragonwell8_jdk   文件: ResourceResolver.java
/**
 * Registers a ResourceResolverSpi class at the beginning of the provider
 * list. This method logs a warning if the class cannot be registered.
 *
 * @param className the name of the ResourceResolverSpi class to be registered
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register a resource resolver
 */
@SuppressWarnings("unchecked")
public static void registerAtStart(String className) {
    JavaUtils.checkRegisterPermission();
    try {
        Class<ResourceResolverSpi> resourceResolverClass =
            (Class<ResourceResolverSpi>) Class.forName(className);
        register(resourceResolverClass, true);
    } catch (ClassNotFoundException e) {
        log.log(java.util.logging.Level.WARNING, "Error loading resolver " + className + " disabling it");
    }
}
 
源代码22 项目: dragonwell8_jdk   文件: ResourceResolver.java
/**
 * Registers a ResourceResolverSpi instance. This method logs a warning if the class
 * cannot be registered.
 * @param resourceResolverSpi
 * @param start
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register a resource resolver
 */
public static void register(ResourceResolverSpi resourceResolverSpi, boolean start) {
    JavaUtils.checkRegisterPermission();
    synchronized(resolverList) {
        if (start) {
            resolverList.add(0, new ResourceResolver(resourceResolverSpi));
        } else {
            resolverList.add(new ResourceResolver(resourceResolverSpi));
        }
    }
    if (log.isLoggable(java.util.logging.Level.FINE)) {
        log.log(java.util.logging.Level.FINE, "Registered resolver: " + resourceResolverSpi.toString());
    }
}
 
源代码23 项目: jdk8u-jdk   文件: Transform.java
/**
 * Registers implementing class of the Transform algorithm with algorithmURI
 *
 * @param algorithmURI algorithmURI URI representation of <code>Transform algorithm</code>
 * @param implementingClass <code>implementingClass</code> the implementing
 * class of {@link TransformSpi}
 * @throws AlgorithmAlreadyRegisteredException if specified algorithmURI
 * is already registered
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register the transform
 */
public static void register(String algorithmURI, Class<? extends TransformSpi> implementingClass)
    throws AlgorithmAlreadyRegisteredException {
    JavaUtils.checkRegisterPermission();
    // are we already registered?
    Class<? extends TransformSpi> transformSpi = transformSpiHash.get(algorithmURI);
    if (transformSpi != null) {
        Object exArgs[] = { algorithmURI, transformSpi };
        throw new AlgorithmAlreadyRegisteredException("algorithm.alreadyRegistered", exArgs);
    }
    transformSpiHash.put(algorithmURI, implementingClass);
}
 
源代码24 项目: jdk8u_jdk   文件: Transform.java
/**
 * Registers implementing class of the Transform algorithm with algorithmURI
 *
 * @param algorithmURI algorithmURI URI representation of <code>Transform algorithm</code>
 * @param implementingClass <code>implementingClass</code> the implementing
 * class of {@link TransformSpi}
 * @throws AlgorithmAlreadyRegisteredException if specified algorithmURI
 * is already registered
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register the transform
 */
public static void register(String algorithmURI, Class<? extends TransformSpi> implementingClass)
    throws AlgorithmAlreadyRegisteredException {
    JavaUtils.checkRegisterPermission();
    // are we already registered?
    Class<? extends TransformSpi> transformSpi = transformSpiHash.get(algorithmURI);
    if (transformSpi != null) {
        Object exArgs[] = { algorithmURI, transformSpi };
        throw new AlgorithmAlreadyRegisteredException("algorithm.alreadyRegistered", exArgs);
    }
    transformSpiHash.put(algorithmURI, implementingClass);
}
 
源代码25 项目: jdk8u-dev-jdk   文件: ResourceResolver.java
/**
 * Registers a ResourceResolverSpi class at the beginning of the provider
 * list. This method logs a warning if the class cannot be registered.
 *
 * @param className the name of the ResourceResolverSpi class to be registered
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register a resource resolver
 */
@SuppressWarnings("unchecked")
public static void registerAtStart(String className) {
    JavaUtils.checkRegisterPermission();
    try {
        Class<ResourceResolverSpi> resourceResolverClass =
            (Class<ResourceResolverSpi>) Class.forName(className);
        register(resourceResolverClass, true);
    } catch (ClassNotFoundException e) {
        log.log(java.util.logging.Level.WARNING, "Error loading resolver " + className + " disabling it");
    }
}
 
源代码26 项目: jdk8u-jdk   文件: XMLSignatureInput.java
private byte[] getBytesFromInputStream() throws IOException {
    if (bytes != null) {
        return bytes;
    }
    if (inputOctetStreamProxy == null) {
        return null;
    }
    try {
        bytes = JavaUtils.getBytesFromStream(inputOctetStreamProxy);
    } finally {
        inputOctetStreamProxy.close();
    }
    return bytes;
}
 
源代码27 项目: TencentKona-8   文件: ResourceResolver.java
/**
 * Registers a ResourceResolverSpi class. This method logs a warning if
 * the class cannot be registered.
 *
 * @param className the name of the ResourceResolverSpi class to be registered
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register a resource resolver
 */
@SuppressWarnings("unchecked")
public static void register(String className) {
    JavaUtils.checkRegisterPermission();
    try {
        Class<ResourceResolverSpi> resourceResolverClass =
            (Class<ResourceResolverSpi>) Class.forName(className);
        register(resourceResolverClass, false);
    } catch (ClassNotFoundException e) {
        log.log(java.util.logging.Level.WARNING, "Error loading resolver " + className + " disabling it");
    }
}
 
源代码28 项目: jdk8u-dev-jdk   文件: Canonicalizer.java
/**
 * Method register
 *
 * @param algorithmURI
 * @param implementingClass
 * @throws AlgorithmAlreadyRegisteredException
 * @throws SecurityException if a security manager is installed and the
 *    caller does not have permission to register the canonicalizer
 */
public static void register(String algorithmURI, Class<? extends CanonicalizerSpi> implementingClass)
    throws AlgorithmAlreadyRegisteredException, ClassNotFoundException {
    JavaUtils.checkRegisterPermission();
    // check whether URI is already registered
    Class<? extends CanonicalizerSpi> registeredClass = canonicalizerHash.get(algorithmURI);

    if (registeredClass != null)  {
        Object exArgs[] = { algorithmURI, registeredClass };
        throw new AlgorithmAlreadyRegisteredException("algorithm.alreadyRegistered", exArgs);
    }

    canonicalizerHash.put(algorithmURI, implementingClass);
}
 
源代码29 项目: TencentKona-8   文件: XMLSignatureInput.java
private byte[] getBytesFromInputStream() throws IOException {
    if (bytes != null) {
        return bytes;
    }
    if (inputOctetStreamProxy == null) {
        return null;
    }
    try {
        bytes = JavaUtils.getBytesFromStream(inputOctetStreamProxy);
    } finally {
        inputOctetStreamProxy.close();
    }
    return bytes;
}
 
源代码30 项目: jdk8u-jdk   文件: XMLSignatureInput.java
private byte[] getBytesFromInputStream() throws IOException {
    if (bytes != null) {
        return bytes;
    }
    if (inputOctetStreamProxy == null) {
        return null;
    }
    try {
        bytes = JavaUtils.getBytesFromStream(inputOctetStreamProxy);
    } finally {
        inputOctetStreamProxy.close();
    }
    return bytes;
}