Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.bouncycastle.pqc.jcajce.provider.util;
 
 
 public class KeyUtil
    public static byte[] getEncodedSubjectPublicKeyInfo(AlgorithmIdentifier algIdASN1Encodable keyData)
    {
        try
        {
            return getEncodedSubjectPublicKeyInfo(new SubjectPublicKeyInfo(algIdkeyData));
        }
        catch (Exception e)
        {
            return null;
        }
    }
    public static byte[] getEncodedSubjectPublicKeyInfo(AlgorithmIdentifier algIdbyte[] keyData)
    {
        try
        {
            return getEncodedSubjectPublicKeyInfo(new SubjectPublicKeyInfo(algIdkeyData));
        }
        catch (Exception e)
        {
            return null;
        }
    }
    public static byte[] getEncodedSubjectPublicKeyInfo(SubjectPublicKeyInfo info)
    {
         try
         {
             return info.getEncoded(.);
         }
         catch (Exception e)
         {
             return null;
         }
    }
    public static byte[] getEncodedPrivateKeyInfo(AlgorithmIdentifier algIdASN1Encodable privKey)
    {
         try
         {
             PrivateKeyInfo info = new PrivateKeyInfo(algIdprivKey.toASN1Primitive());
             return getEncodedPrivateKeyInfo(info);
         }
         catch (Exception e)
         {
             return null;
         }
    }
    public static byte[] getEncodedPrivateKeyInfo(PrivateKeyInfo info)
    {
         try
         {
             return info.getEncoded(.);
         }
         catch (Exception e)
         {
             return null;
         }
    }
New to GrepCode? Check out our FAQ X