/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/*
* Copyright 2005 The Apache Software Foundation.
*
* Licensed 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
*
*
* 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.
*
*/
/*
*/
/*
* $Id: DOMKeyValue.java,v 1.2 2008/07/24 15:20:32 mullan Exp $
*/
/**
* DOM-based implementation of KeyValue.
*
* @author Sean Mullan
*/
// DSAKeyValue CryptoBinaries
// RSAKeyValue CryptoBinaries
throw new NullPointerException("key cannot be null");
}
if (key instanceof DSAPublicKey) {
} else if (key instanceof RSAPublicKey) {
} else {
throw new KeyException("unsupported key algorithm: " +
key.getAlgorithm());
}
}
/**
* Creates a <code>DOMKeyValue</code> from an element.
*
* @param kvElem a KeyValue element
*/
} else {
}
}
throw new KeyException("can't convert KeyValue to PublicKey");
} else {
return publicKey;
}
}
throws MarshalException {
// create KeyValue element
}
if (publicKey instanceof DSAPublicKey) {
// create and append DSAKeyValue element
} else if (publicKey instanceof RSAPublicKey) {
// create and append RSAKeyValue element
} else {
" public key algorithm not supported");
}
} else {
}
}
// parameters J, Seed & PgenCounter are not included
}
}
throws MarshalException {
try {
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException("unable to create DSA KeyFactory: " +
e.getMessage());
}
}
// check for P and Q
}
}
}
}
//@@@ do we care about j, pgenCounter or seed?
}
throws MarshalException {
try {
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException("unable to create RSA KeyFactory: " +
e.getMessage());
}
}
}
try {
} catch (InvalidKeySpecException e) {
//@@@ should dump exception to log
return null;
}
}
if (this == obj) {
return true;
}
return false;
}
try {
return false;
}
return false;
}
} catch (KeyException ke) {
// no practical way to determine if the keys are equal
return false;
}
return true;
}
}