Package java.security.cert

Examples of java.security.cert.CertificateEncodingException


      }

        encoded = new DERSequence(v);
  }
  else
      throw new CertificateEncodingException( "unsupported encoding" );

  if ( encoded == null )
      return null;

  ByteArrayOutputStream outStream = new ByteArrayOutputStream();
        DEROutputStream derOutStream = new DEROutputStream(outStream);

  try {
      derOutStream.writeObject( encoded );
      derOutStream.close();
  } catch ( IOException ex ) {
      throw new CertificateEncodingException( "IOExeption thrown: " + ex.toString() );
  }

        return outStream.toByteArray();
    }
View Full Code Here


            return bOut.toByteArray();
        }
        catch (IOException e)
        {
            throw new CertificateEncodingException(e.toString());
        }
    }
View Full Code Here

            return new X509Principal(X509Name.getInstance(tbsCert.getIssuer()));
        }
        catch (IOException e)
        {
            throw new CertificateEncodingException(e.toString());
        }
    }
View Full Code Here

                    ASN1Primitive.fromByteArray(cert.getTBSCertificate()));
            return new X509Principal(X509Name.getInstance(tbsCert.getSubject()));
        }
        catch (IOException e)
        {
            throw new CertificateEncodingException(e.toString());
        }
    }
View Full Code Here

            return null;
        }

        public byte[] getTBSCertificate() throws CertificateEncodingException
        {
            throw new CertificateEncodingException();
        }
View Full Code Here

        public byte[] getEncoded() throws CertificateEncodingException
        {
            if (_exceptionOnEncode)
            {
                throw new CertificateEncodingException();
            }
           
            return new byte[0];
        }
View Full Code Here

        {
            return c.getTBSCertificate().getEncoded(ASN1Encoding.DER);
        }
        catch (IOException e)
        {
            throw new CertificateEncodingException(e.toString());
        }
    }
View Full Code Here

        {
            return c.getEncoded(ASN1Encoding.DER);
        }
        catch (IOException e)
        {
            throw new CertificateEncodingException(e.toString());
        }
    }
View Full Code Here

           
                pWrt.close();
            }
            catch (Exception e)
            {
                throw new CertificateEncodingException("can't encode certificate for PEM encoded path");
            }

            return bOut.toByteArray();
        }
        else
        {
            throw new CertificateEncodingException("unsupported encoding: " + encoding);
        }
    }
View Full Code Here

        {
            return new ASN1InputStream(cert.getEncoded()).readObject();
        }
        catch (Exception e)
        {
            throw new CertificateEncodingException("Exception while encoding certificate: " + e.toString());
        }
    }
View Full Code Here

TOP

Related Classes of java.security.cert.CertificateEncodingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.