You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@labs.apache.org by si...@apache.org on 2010/01/30 22:09:25 UTC
svn commit: r904885 -
/labs/amber/signature-api/src/main/java/org/apache/labs/amber/signature/signers/rsa/PemRsaSha1SigningKey.java
Author: simonetripodi
Date: Sat Jan 30 21:09:24 2010
New Revision: 904885
URL: http://svn.apache.org/viewvc?rev=904885&view=rev
Log:
first checkin of PemRsaSha1SigningKey class
Added:
labs/amber/signature-api/src/main/java/org/apache/labs/amber/signature/signers/rsa/PemRsaSha1SigningKey.java (with props)
Added: labs/amber/signature-api/src/main/java/org/apache/labs/amber/signature/signers/rsa/PemRsaSha1SigningKey.java
URL: http://svn.apache.org/viewvc/labs/amber/signature-api/src/main/java/org/apache/labs/amber/signature/signers/rsa/PemRsaSha1SigningKey.java?rev=904885&view=auto
==============================================================================
--- labs/amber/signature-api/src/main/java/org/apache/labs/amber/signature/signers/rsa/PemRsaSha1SigningKey.java (added)
+++ labs/amber/signature-api/src/main/java/org/apache/labs/amber/signature/signers/rsa/PemRsaSha1SigningKey.java Sat Jan 30 21:09:24 2010
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.labs.amber.signature.signers.rsa;
+
+import java.io.InputStream;
+import java.net.URL;
+
+import org.apache.labs.amber.signature.signers.SignatureException;
+
+/**
+ * Implementation of a PEM RSA private key.
+ *
+ * @version $Id$
+ */
+public final class PemRsaSha1SigningKey extends AbstractRsaSha1SigningKey {
+
+ /**
+ * Instantiate a new PEM RSA private key reading the certificate from the URL.
+ *
+ * @param certificateLocation the certificate from the URL.
+ * @throws SignatureException if any error occurs while reading the
+ * certificate.
+ */
+ public PemRsaSha1SigningKey(URL certificateLocation) throws SignatureException {
+ super(certificateLocation);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected byte[] readCertificate(InputStream input) throws SignatureException {
+ PemCertificateParser parser = new PemCertificateParser(input);
+ try {
+ return parser.parsePrivateKey();
+ } catch (ParseException e) {
+ throw new SignatureException("Syntax error while parsing private key", e);
+ }
+ }
+
+}
Propchange: labs/amber/signature-api/src/main/java/org/apache/labs/amber/signature/signers/rsa/PemRsaSha1SigningKey.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: labs/amber/signature-api/src/main/java/org/apache/labs/amber/signature/signers/rsa/PemRsaSha1SigningKey.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: labs/amber/signature-api/src/main/java/org/apache/labs/amber/signature/signers/rsa/PemRsaSha1SigningKey.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org