aboutsummaryrefslogtreecommitdiffstats
path: root/libraries/spongycastle/prov/src/main/java/org/spongycastle/pqc/jcajce/provider/util/KeyUtil.java
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/spongycastle/prov/src/main/java/org/spongycastle/pqc/jcajce/provider/util/KeyUtil.java')
-rw-r--r--libraries/spongycastle/prov/src/main/java/org/spongycastle/pqc/jcajce/provider/util/KeyUtil.java72
1 files changed, 0 insertions, 72 deletions
diff --git a/libraries/spongycastle/prov/src/main/java/org/spongycastle/pqc/jcajce/provider/util/KeyUtil.java b/libraries/spongycastle/prov/src/main/java/org/spongycastle/pqc/jcajce/provider/util/KeyUtil.java
deleted file mode 100644
index ae780b6d2..000000000
--- a/libraries/spongycastle/prov/src/main/java/org/spongycastle/pqc/jcajce/provider/util/KeyUtil.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package org.spongycastle.pqc.jcajce.provider.util;
-
-import org.spongycastle.asn1.ASN1Encodable;
-import org.spongycastle.asn1.ASN1Encoding;
-import org.spongycastle.asn1.pkcs.PrivateKeyInfo;
-import org.spongycastle.asn1.x509.AlgorithmIdentifier;
-import org.spongycastle.asn1.x509.SubjectPublicKeyInfo;
-
-public class KeyUtil
-{
- public static byte[] getEncodedSubjectPublicKeyInfo(AlgorithmIdentifier algId, ASN1Encodable keyData)
- {
- try
- {
- return getEncodedSubjectPublicKeyInfo(new SubjectPublicKeyInfo(algId, keyData));
- }
- catch (Exception e)
- {
- return null;
- }
- }
-
- public static byte[] getEncodedSubjectPublicKeyInfo(AlgorithmIdentifier algId, byte[] keyData)
- {
- try
- {
- return getEncodedSubjectPublicKeyInfo(new SubjectPublicKeyInfo(algId, keyData));
- }
- catch (Exception e)
- {
- return null;
- }
- }
-
- public static byte[] getEncodedSubjectPublicKeyInfo(SubjectPublicKeyInfo info)
- {
- try
- {
- return info.getEncoded(ASN1Encoding.DER);
- }
- catch (Exception e)
- {
- return null;
- }
- }
-
- public static byte[] getEncodedPrivateKeyInfo(AlgorithmIdentifier algId, ASN1Encodable privKey)
- {
- try
- {
- PrivateKeyInfo info = new PrivateKeyInfo(algId, privKey.toASN1Primitive());
-
- return getEncodedPrivateKeyInfo(info);
- }
- catch (Exception e)
- {
- return null;
- }
- }
-
- public static byte[] getEncodedPrivateKeyInfo(PrivateKeyInfo info)
- {
- try
- {
- return info.getEncoded(ASN1Encoding.DER);
- }
- catch (Exception e)
- {
- return null;
- }
- }
-}