Example usage for java.security NoSuchProviderException NoSuchProviderException

List of usage examples for java.security NoSuchProviderException NoSuchProviderException

Introduction

In this page you can find the example usage for java.security NoSuchProviderException NoSuchProviderException.

Prototype

public NoSuchProviderException(String msg) 

Source Link

Document

Constructs a NoSuchProviderException with the specified detail message.

Usage

From source file:Main.java

static Provider getProvider(String provider) throws NoSuchProviderException {
    Provider prov = Security.getProvider(provider);

    if (prov == null) {
        throw new NoSuchProviderException("Provider " + provider + " not found");
    }/*  w w  w  .ja v a2 s.c  o  m*/

    return prov;
}