Package org.smslib.crypto

Examples of org.smslib.crypto.KeyManager


  private static final long serialVersionUID = 2L;

  public OutboundEncryptedMessage(String myRecipient, byte[] dataBytes) throws SMSLibException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, NoSuchPaddingException, NoSuchAlgorithmException
  {
    setRecipient(myRecipient);
    KeyManager km = KeyManager.getInstance();
    setDataBytes(km.encrypt(myRecipient, dataBytes));
  }
View Full Code Here


    super(pdu, memIndex, memLocation);
  }

  public String getDecryptedText() throws SMSLibException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, NoSuchPaddingException, NoSuchAlgorithmException
  {
    KeyManager km = KeyManager.getInstance();
    if (km.getKey(getOriginator()) != null) setDataBytes(km.decrypt(getOriginator(), getDataBytes()));
    else throw new SMSLibException("Message is not encrypted, have you defined the key in KeyManager?");
    return AKey.asString(getDataBytes());
  }
View Full Code Here

TOP

Related Classes of org.smslib.crypto.KeyManager

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.