YourOwnProvider.java Source code

Java tutorial

Introduction

Here is the source code for YourOwnProvider.java

Source

import java.security.Provider;

public class YourOwnProvider extends Provider {
    public YourOwnProvider() {
        super("YourOwn", 1.0, "YourOwn Security Provider v1.0");
        put("KeyGenerator.XOR", "yourPackageName.XORKeyGenerator");
        put("KeyPairGenerator.YourOwn", "yourPackageName.YourOwnKeyPairGenerator");
        put("KeyFactory.YourOwn", "yourPackageName.YourOwnKeyFactory");
        put("MessageDigest.YourOwn", "yourPackageName.YourOwnMessageDigest");
        put("Signature.YourOwnwithSHA", "yourPackageName.YourOwnSignature");
        put("Cipher.XOR", "yourPackageName.XORCipher");
        put("KeyManagerFactory.YourOwn", "yourPackageName.SSLKeyManagerFactory");
        put("Alg.Alias.MessageDigest.SHA-1", "SHA");
    }

    public static final synchronized void verifyForJCE() {
        throw new SecurityException("Can't verify for JCE");
    }
}